[futurebasic] Re: a useful function...

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 1997 : Group Archive : Group : All Groups

From: Rick Brown <rbrown@...>
Date: Sat, 29 Nov 1997 11:59:09 -0600
Bowerbird wrote:
> ' -- getkeys.bas -- from code provided by rich love...  thanks rich!
> COMPILE 0,_caseinsensitive
> DIM ggetkeys%(32)
> DIM ggetkey_command%
> DIM ggetkey_period%
> DIM ggetkey_escape%
> DIM ggetkey_shift%
> DIM ggetkey_control%
> DIM ggetkey_option%
> END GLOBALS
> 
> LOCAL FN modifiers 
>   CALL GETKEYS (ggetkeys%(0))
>   ggetkey_command%=FN BITTST(VARPTR(ggetkeys%(3)),0&)'command
>   ggetkey_period%=FN BITTST(VARPTR(ggetkeys%(2)),8&)'period
>   ggetkey_escape%=FN BITTST(VARPTR(ggetkeys%(3)),2&)'escape
>   ggetkey_shift%=FN BITTST(VARPTR(ggetkeys%(3)),15&)'shift
>   ggetkey_control%=FN BITTST(VARPTR(ggetkeys%(3)),12&)'control
>   ggetkey_option%=FN BITTST(VARPTR(ggetkeys%(3)),13&)'option
> END FN
(*snip*)

Hey, guys, don't forget that FB has a _built_in_ function that will do
this for you!  Take a look at the EVENT% function (not to be confused
with the EVENT function or the EVENT& function).

- Rick