Detecting 2 hardbuttons being pressed

Postby FREEMAN on Fri Sep 06, 2002 3:08 pm

Hi, I am programming a game in POCKETC and I am currently using Hookhard(1); and then event(0); to identify if a hardbutton was pressed. It is working great with the only exception that I am not able to detect 2 buttons at the same time.

In other words I will like to be able to fire a misile by pressing a second button while I am moving left or right using the first button. Right now I am only able to fire a missile if I stop pressing the first button.

Does anybody knows a solution to this?

Thanks...

LF
LF
FREEMAN
 
Posts: 1
Joined: Fri Sep 06, 2002 2:54 pm
Location: USA

Postby jstadolnik on Fri Sep 06, 2002 3:28 pm

The PalmOS cannot trap simultaneous events. However, you can check the state of the hard keys directly with the CheckKey() function in the PToolboxLib, and fake this out.

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA


Return to PocketC for Palm OS KB

Who is online

Users browsing this forum: No registered users and 2 guests

cron