[futurebasic] Re: [FB] FBtoC and the Clear Key using _KeyDwnEvt

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

From: Brian Stevens <bstevens33@...>
Date: Tue, 10 Jun 2008 08:10:55 -0700
On Jun 6, 2008, at 7:46 AM, Rich Love wrote:

> Not sure if the ever got logged as a bug since I received no reply.

Has not been logged because I can't see a bug with global vars not  
working.

> ......... FBtoC has a problem with setting a global variable within  
> this LOCAL FN.


Not that I can see. Here is the code snippet I used. It works just  
fine in FBtoC. ( I don't have a clear key on my keyboard, so I  
modified this for any key --I was pressing keys a,s,d,f,g,h ). Brian S.

'------------------
dim gAnyKey
end globals

local fn CheckKeyCodeForClear
'~'1
gAnyKey = 0
dim ev as ^EventRecord
dim as unsigned char keyCode
ev = event
select ( ev.what )
case _keyDwnEvt
gAnyKey = 1
end select
end fn

window 1
print "Hit any key and see if FBtoC recognizes it"

do
HandleEvents
fn CheckKeyCodeForClear // FB event polling not guaranteed to work in  
FBtoC
if gAnyKey then print "I saw the key press"
until ( gFBQuit )
'---------------