NewB Q: event()

Discuss PocketC for Palm OS (including Desktop Edition)

Postby soinsg on Thu May 17, 2001 4:34 pm

I want to use the event button to detect [2] penDown OR [3] penUp, but not both. The numbers like this: [2] and [3], what do they mean in the PocketC functions documentation (for event())? Can I chose what event() detects? If so, how? I can't use wait() or waitp() because it is a kind of tap the target game, where the target dissappears if you are too slow. Any realistic ideas welcome. The effect that I want to achieve is possible because I have several PocketC games (not my own) where this happens. Please email me replies to: <a href="mailto:soinsg@hotmail.com">soinsg@hotmail.com</a><font face=Arial></font id=Arial>

--
soinsg@hotmail.com
soinsg
 
Posts: 198
Joined: Thu May 17, 2001 4:26 pm

Postby Tom Miller on Fri May 18, 2001 12:46 pm

Do it like this:

while(1)//execute indefinitely
e=event(0)//the "0" means if no event in queue keep going
if(e==3) doPenUpEvent();//trap penup first to exclude pendown
if(e==2) doPenDownEvent();//this will trap the pendown
}//endwhile

On a pendown event, doPenDownEvent() will execute, and when you come back to this loop, the subsequent penup event will be trapped.

Regards,
Tom Miller
Tom Miller
 
Posts: 80
Joined: Thu Mar 15, 2001 2:27 pm

Postby soinsg on Sat May 19, 2001 1:47 pm

After a bit of fiddling and rearranging of the order of the things in my functions, i got it to do almost what i want. i am satisfied.

--
soinsg@hotmail.com
soinsg
 
Posts: 198
Joined: Thu May 17, 2001 4:26 pm


Return to PocketC for Palm OS

Who is online

Users browsing this forum: No registered users and 1 guest

cron