This site is no longer active and is available for archival purposes only. Registration and login is disabled.

one button press - two key codes !?


one button press - two key codes !?

Postby BIGBEN » Jan 30, 2005 @ 4:48pm

I have ASUS A620BT + eVC 3.0 + PF_0_8_1

During my game if I press left, up, right or down button on my PocketPC
The - void Pyromania::ButtonDown (int button){} is called

At first I get the right key code (from int button) - 37, 38, 39, 40 (the same as vkLeft, vkUp...)
but suddenly after that the ButtonDown called with the second "wrong key code" it is the same key code for all four buttons - 132 !?

When I press any other button - contacts, record etc.
At first I get the "wrong key code" - it is the same for all other buttons - 91
and suddenly after that I get the right key code 193, 194 etc - different for different buttons.

I use the standard PocketFrog_0_8_1 game class with virtual ButtonDown function?

Now I filter incoming keycodes with something like this:

void Pyromania::ButtonDown (int button)
{
if(inbutton ==m_keys.vkRight || inbutton ==m_keys.vkA || //etc )
{
//Get input
}
}

so is the key codes:

int16_t vkUp;
int16_t vkDown;
int16_t vkLeft;
int16_t vkRight;
int16_t vkStart;
int16_t vkA;
int16_t vkB;
int16_t vkC;
int16_t vkAux1;
int16_t vkAux2;
int16_t vkAux3;
int16_t vkAux4;
int16_t vkAux5;
int16_t vkAux6;
int16_t vkAux7;
int16_t vkAux8;

(as seen in input.h)
all the "right keycodes" I could receive on "average PocketPC device" (without hardware keyboard)
I'm asking because I have customizable buttons in my game and I should separate right from wrong key codes. Is there any other better way?
User avatar
BIGBEN
pm Member
 
Posts: 281
Joined: Mar 18, 2003 @ 10:18pm
Location: Saint-Petersburg, Russia


Postby BIGBEN » Jan 30, 2005 @ 4:57pm

P.S. Fogot to say: I've read previous threads about "phantom keycodes", but I still cannot understand how could I separate this phantom keycodes from normal one.
Because if((m_keys.vkUp == button || m_keys.vkDown == button etc){do something} is not the best solution - it restricts some true, not phantom key codes from access on my PC, for example.
User avatar
BIGBEN
pm Member
 
Posts: 281
Joined: Mar 18, 2003 @ 10:18pm
Location: Saint-Petersburg, Russia


Postby fast_rx » Jan 30, 2005 @ 7:57pm

User avatar
fast_rx
pm Member
 
Posts: 660
Joined: Jun 10, 2003 @ 4:24pm


Postby BIGBEN » Jan 30, 2005 @ 11:14pm

User avatar
BIGBEN
pm Member
 
Posts: 281
Joined: Mar 18, 2003 @ 10:18pm
Location: Saint-Petersburg, Russia


Return to PocketFrog & PocketHAL


Sort


Forum Description

SDKs for fast and robust device-independent access to Pocket PC display hardware.

Moderators:

sponge, Kzinti

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron