[futurebasic] Re: [FB] Converting events

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

From: Mars Saxman <marssaxman@...>
Date: Mon, 15 Jun 98 22:07:27 -0800
>It was straightforward to read the serial port in the main loop and get 
>the character.  And I could certainly write a whole separate set of 
>handlers for the serial input.  But is there a way to 'fool' the program 
>into thinking an _evkey event occurred and use the same handlers that are 
>already written and debugged?

Sure - FN POSTEVENT. It'll post pretty much any MacOS event you want into 
the system-wide event queue. If your application is frontmost, you'll 
receive the event you posted.

If you don't want incoming keypresses to affect other applications, then 
set a flag when your app gets switched to the background, and don't call 
POSTEVENT when the flag is set.

-Mars