How can I detect the "ABC" key event using Symbian C++?
Article Metadata
Compatibility
Platform(s): S60 1st Edition
S60 2nd Edition
S60 2nd Edition
Article
Created: User:Technical writer 2
(04 Jun 2004)
Last edited: hamishwillee
(14 Jun 2012)
Overview
How can I detect the "ABC" key?
Description
What are the TKeyEvent.iCode and iScanCode values of the "ABC" (pencil) key?
Solution
The ABC key is mapped to the Shift modifier key in S60. The following code detects it:
TKeyResponse CMyClass::OfferKeyEventL(...)
{
TBool shiftKeyPressed = (aKeyEvent.iModifiers & EModifierShift);
...
}
The keycode and scancodes depend on the key pressed with the Shift key. The following code detects Shift+OK combination in a listbox's OfferKeyEventL(), where it is used to mark a listbox item:
TKeyResponse CMyBusinessClass::OfferKeyEventL(...)
{
TBool shiftKeyPressed = (aKeyEvent.iModifiers & EModifierShift);
if (shiftKeyPressed && aKeyEvent.iCode==EKeyOK)
DoSomething();
...
}


(no comments yet)