PocketMatrix forums

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

GAPI and virtual key code for 4th button

Hi all,

I have a Jornada 568 that has the standard 4 buttons on the bottom of the device plus the arrow keypad. The GAPI routine GXGetDefaultKeys only returns data for vkA, vkB and vkC. Is there a standard hardware code for "vkD" or that fourth button? On my device its virtual key is 213. The others are 209, 210 and 211 and vkStart is 212.

Are these fairly standard? What are people doing to query that 4th button? I'm using GetAsyncKeyState but don't want to hardcode in 213 if it's incorrect.

Thanks for any info.

Werner Sharp
http://www.sharp-software.com
BurningSheep · 01 Aug 2002, 16:01 UTC
These codes differ from device to device, I would consider letting the player assign the keys to his preferred configurations. Also there should be a list of these keycodes around here somewhere on the forum.
I was about to start a new thread on this, until I found this thread. Anyway here's my post:

GXGetDefaultKeys only returns the values of 3 of the 4 hardware buttons on the front of a PPC (that's all the GXKeyList struct allows).

How are others determining the value of that 4th key? On the a716 it happens to be GXKeyList::vkC-1, however that doesn't hold up with the a620.

Thanks.

Dan East
I use PocketHAL =) It returns up to 11 buttons key codes.
This is for my PSX Adapter, which does not / need not actually access the display. I'll have to take a closer look at PocketHAL.

How does PocketHAL manage this? Are these values hard-coded by device type? Or is it able to obtain the additional information from the lower level drivers that it accesses directly?

Dan East
Dan East wrote:I was about to start a new thread on this, until I found this thread. Anyway here's my post:

GXGetDefaultKeys only returns the values of 3 of the 4 hardware buttons on the front of a PPC (that's all the GXKeyList struct allows).

How are others determining the value of that 4th key? On the a716 it happens to be GXKeyList::vkC-1, however that doesn't hold up with the a620.

Thanks.

Dan East


I'm also very interested in any clue on this subject.
How to find the code of the 4th virtual key ?

Maybe an heuristic analysing sequence gaps in vkA, vkB and vkC could work. If there is no gap, take vkA-1...

I'm not sure I'll work on any Pocket PC, though...
Does anybody have the list of virtual key codes for each device so that I can see if my heuristic works?

Thanks,
madfrog
I've spoken to Thierry about this, and he goes to pretty far lengths to obtain the values of additional keys. I recommend you try PocketHAL. The usage is as simple as using GAPI:

Code:

#include "PocketHAL.h"

...
PHAL::KeyList keys;
PHAL::GetKeyList(&keys;, PHAL::ORIENTATION_NORMAL);


Dan East
I think getting key values like this should be in a small dedicated library of its own. Such a library would work with GAPI, GapiDraw, PocketHAL/Frog, etc.
mlepage wrote:I think getting key values like this should be in a small dedicated library of its own. Such a library would work with GAPI, GapiDraw, PocketHAL/Frog, etc.


The "small dedicated library" *is* PocketHAL. It works with PocketFrog, GAPI, GAPIDraw and by itself. Since PocketHAL is a .lib, you can use only GetKeyList() and all the display stuff will be discarded at link time.
My driver grew less than 5k switching from GAPI to PocketHAL.

Dan East
Thierry":3p6337zk]

I see your point, if the display stuff is unused I guess that's acceptable.
mlepage wrote:I see your point, if the display stuff is unused I guess that's acceptable.


That's precisely why GetKeyList() isn't part of class "Display". It is also why GetKeyList() takes the orientation as a parameter (I made sure it wasn't tied to the display).

The design philosophy behind PocketHAL is to provide basic building blocks that aren't dependant on each others. There isn't much (yet) beside the display part, but hey, it's a start.