Datasheet
50 SYMBIANOSGAMEBASICS
input = KControllerDown; // 0x00000002;
break;
case EStdKeyLeftArrow: // 4-way controller left
input = KControllerLeft; // 0x00000004;
break;
case EStdKeyRightArrow: // 4-way controller right
input = KControllerRight; // 0x00000008;
break;
case EStdKeyDevice3: // 4-way controller center
input = KControllerCentre;
// This is the "fire ammo" key
// Store the event, the loop will handle and clear it
if (EEventKey == aType)
{
iFired = ETrue;
}
...
default:
response = EKeyWasNotConsumed;// Keypress was not handled
break;
}
if (EEventKeyDown == aType)
{// Store input to handle in the next update
iKeyState |=input; // set bitmask
}
else if (EEventKeyUp == aType)
{// Clear the input
iKeyState &= ∼input; // clear bitmask
}
return (response);
}
TKeyEvent and TEventCode are passed in as parameters to Offer-
KeyEventL(), and contain three important values for the key press – the
event type, scan code, and character code for the key. Let’s discuss these
in some further detail.
2.4.1 Key Events
Key events are delivered to the application by the Symbian OS window
server (WSERV). WSERV uses a typical GUI paradigm which works well
for controls such as text editors and list boxes. That is, when a key is
held down, it generates an initial key event, followed by a delay and
then a number of repeat key events, depending on the keypad repeat rate
setting, until it is released.
There are three possible key event types. Each key press generates the
three event types in sequence:
1. EEventKeyDown – generated when the key is pressed down