PocketMatrix forums

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

Key 91 problem

Could anyone help me with getting the correct key values in GapiDraw?
Whatever button from the front of the PDA I press, the CGapiApplication::KeyDown function always receives dwKey == 91, which doesn't represent any of the keylist members.
Any idea of what could be the problem?
"Shadow" keycodes:
http://www.pocketmatrix.com/forums/viewtopic.php?t=10902

By the way, did anyone actually figure out what they're there for?
When you pressed a button it will return 91 first before the actual value. So what I did is this and it worked. I cant explain why hehe

The idea is I have to fake the first keypressed with case 0: first then get the actual value on the index increment. Looks weird but it working ;-)

Code:
HRESULT CMyApplication::KeyDown(DWORD dwKey, GDKEYLIST& keylist)
{

if (GameStatus==DEF_CONFIGURE) // Configure control buttons
{
if (IsConfigureButton)
{
switch(ConfigureButtonIndex)
{
case 0:
case 1: ShootButton = dwKey; break;
case 2:
case 3: SelectButton = dwKey; break;
case 4:
case 5: SpecialButton = dwKey; break;
case 6:
case 7: ReturnButton = dwKey; break;
}

ConfigureButtonIndex++;

if (ConfigureButtonIndex>7)
{
ConfigureButtonIndex = 0;
IsConfigureButton = FALSE;
}
}
}
}
What device are you seeing this problem on? I've not had any reports of incorrect keypad/button functionality in Warlords II. Here is a stripped down version of the code I use in the KeyDown(...) method for reference. There's certainly nothing earth-shattering here...

Code:

if (dwKey == keylist.vkUp) m_dwKey |= 1;
else if (dwKey == keylist.vkDown) m_dwKey |= 2;
else if (dwKey == keylist.vkLeft) m_dwKey |= 4;
else if (dwKey == keylist.vkRight) m_dwKey |= 8;
else if (dwKey == keylist.vkStart) m_dwKey |= 16;
else if (dwKey == keylist.vkA) m_dwKey |= 32;
else if (dwKey == keylist.vkB) m_dwKey |= 64;
else if (dwKey == keylist.vkC) m_dwKey |= 128;


I then use the m_dwKey value to determine how to proceed in ProcessNextFrame( ). I clear these values in a similar fashion in KeyUp( ).
Hi GR: I'm talking about allowing the users to configure buttons on their devices ;-) That's waiting for a keypressed and assigning the value in a variables.