[futurebasic] Re: [FB] Fkeys and FBtoC

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2008 : Group Archive : Group : All Groups

From: Joe Lertola <joefb@...>
Date: Wed, 9 Apr 2008 23:23:25 -0400
Thanks Stu, but I don't think I can use INKEY$. I want to check the  
escape key periodically during a long process as a way for the user to  
cancel the process. I have been using the GETKEYS function for this  
but I see from the discussion in this thread that will not work with  
FBtoC, so I need to find an alternative method to let the user cancel  
the process.

On Apr 9, 2008, at 10:59 PM, Stu Cram wrote:

>
> On Apr 9, 2008, at 8:28 PM, Joe Lertola wrote:
>> Is there any way to detect the escape key without using the GETKEYS  
>> function?
>>
> ---------------
>
> The ASCII code for the 'ESC' key is 27.
> Here's a short routine to get ASCII values.
>
> ' ======================= Start of example
> DIM 1 key$
> DIM as short asciiValue
> WINDOW 1
> TEXT _helvetica, 14
> CLS
> PRINT" SHOWING ASCII VALUES FOR KEYS..."
> PRINT " (Press Q to quit.)
> PRINT
>
> DO
> Print "Press any key: ";
>  DO
>    key$ = INKEY$
>  UNTIL key$ <> ""
>  asciiValue = ASC( key$ )
>  PRINT key$;  using " ---> ###"; asciiValue
>  PRINT
> UNTIL UCASE$( key$ ) = "Q"
> END
> ' ======================= End of example
>
>
> PS1 - This example gives 16 as the value for all function keys.
>      More code is needed to detect them.
> PS2 - Use Robert's function to detect the modifier keys.
>
> Hope this helps.
> -Stu
>
> --
> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...
>