Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
N97 Qt Keyboard Codes (QWERTY)
This article shows how Qt reports hardware keyboard keystrokes via a QKeyEvent. In the event are several properties pertaining to the keystroke:
For the N97 S60 platform the following key mappings occur:
For all of the graphic keys, key, nativeVirtualKey, and the numeric value of the character in text are identical, and have the ASCII value of the graphic that would be displayed, given the software mode of the keyboard and the shift state. nativeScanCode has the ASCII value of the upper case alphabetic corresponding to the key.
For unshifted keys, modifiers is zero and nativeModifiers is 0x1. If shift is held down during the keystroke, modifiers has a value of 0x2000000 and nativeModifiers has a value of 0x501. If Sym is held down during the keystroke, modifiers has a value of zero and nativeModifiers has a value of 0x2801. If the north-west pointing arrow is held down, modifiers is zero and nativeModifiers has a value of 0x3001.
Of the special keys, backspace (west pointing arrow) has a key value of 0x1000003 (in all shifts), nativeVirtualKey value of 0x8, nativeScanCode value of 0x1. Carriage-return has a key of 0x1000005, nativeVirtualKey of 0xD (ASCII carriage return), nativeScanCode of 0x3.
The left cursor control button has a key of 0x1000012, nativeVirtualKey of 0xF807, nativeScanCode of 0xE. The right cursor control button has a key of 0x1000014, nativeVirtualKey of 0xF808, nativeScanCode of 0xF. The up button has a key of 0x1000013, nativeVirtualKey of 0xF809, nativeScanCode of 0x10. The down button has a key of 0x1000015, a nativeVirtualKey of 0xF80A, nativeScanCode of 0x11. The center button has a key of 0x1010000, nativeVirtualKey of 0xF845, nativeScanCode of 0xA7.
None of the above special key values appear to be affected by any of the shift keys, although the modifiers are the same as with the alphabetic keys.