PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Developer question on key codes in GAPI

Frank W. Zammetti · 21 May 2001, 14:42 UTC
Hi guys, I thought this might be a good place to ask this...

After looking through the PocketQuake source and not having any luck find my own answer, my question is this...

How do you recognize a diagonal button press?  I'm using an E-125, and I know this may be a problem on an iPaq, but one thing at a time...

It seems like you get the vKey codes for the two directions constituting the keypress in WM_KEYDOWN messages in quick succession and I haven't figured out if there is another way to recognize it or how to process that properly.

Any help you could throw my way would be much appreciated.  Thanks all!
If you are handling keypresses via messages, as PQ does, then you would receive two sequential key down messages for the two directions that are being pressed together. Your app has to keep track of the up down state of each button, and behave accordingly when two have the down state at the same time.

Dan East
You can also poll for key states using the GetKeyState function, instead of waiting for messages to come your way. If you are only using a small number of controls (as opposed to handling full keyboard input, like PQ), then that may be the better option.

Dan East
SonicSilicon · 21 May 2001, 17:18 UTC
Seperate codes for diagonal directions. . . sounds like how an Atari handles it, except it generated a specific number for each direction including centered.

I can't - beleive - I - just - wrote that.
Frank W. Zammetti · 21 May 2001, 18:21 UTC
Ah yes, and now I feel totally silly for not figuring that out on my own!

I do appreciate the help though.  I also didn't rezlize there was a general development forum (I linked to this board from another site, didn't really look around first), I would have posted there had I seen it.

Thanks again very much! (Unfortunately, now that I know how quick and helpful you guys are, I may bug you more...)