[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: Robert Purves <listrp@...>
Date: Sat, 7 Jun 2008 00:06:30 +1200
Rich Love wrote:

> There is a problem with FBtoC and the clear key on the extended  
> keyboard when using _KeyDwnEvt
> It will intermittently return a zero value for the keycode (about  
> 75% of the time in my tests).
> I have tested this with FB and it works perfect.
> Also, have tried FBtoC 1.06 through 1.1 and it fails (don't know  
> about previous versions).
> Here is a test program to show the problem.


< snip >


You are polling for FB _keyDwnEvt events in a manner that has no  
support in FBtoC. Please use 'on dialog' or 'on event' to trap  
keypresses.

local fn CheckKeyCodeForClear
'~'1
dim ev as ^EventRecord
dim as unsigned char keyCode
ev = event
select ( ev.what )
case _keyDwnEvt
keycode = ( ev.message >> 8 ) and 255
if ( keycode == 71 ) then print "I saw the clear key"
end select
end fn

window 1
print "Hit the clear key and see if FBtoC recognizes the key."

//on dialog fn CheckKeyCodeForClear // OK
//on event fn CheckKeyCodeForClear // OK
do
HandleEvents
fn CheckKeyCodeForClear // FB event polling not guaranteed to work in  
FBtoC
until ( gFBQuit )


Robert P.