Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
For an overview on character input in Qt for Embedded Linux see : Qt for Embedded Linux Character Input.
For a tutorial discussing adding a keyboard driver plug-in see : Tutorial: Implementing a Device Plug-in
Nearly all Phones and PDAs have keys that are not found on a regular computer keyboard. In order for Qt Extended to function correctly when installed on a device, it needs these keys to be defined. The easiest way to do this is to have the keyboard driver for the device emit the scancodes for the existing mapping for Qt Extended.
In addition to the mapping for a PC US-101 keyboard, the following table defines the codes that are either required, available or optional:
Scancode | Qt Key Code | Description | Keypad Mode | no keypad mode |
---|---|---|---|---|
65 | Key_Menu | Application menu key | Optional | Not Available |
67 | Key_Back | Accept/Close dialog key | Required | Not Available |
68 | Key_Yes | Yes | Optional | Not Available |
69 | Key_No | No | Optional | Not Available |
87 | Key_Call | Start call, accept incoming call | Optional | Not Available |
88 | Key_Hangup | End call, reject incoming call | Optional | Not Available |
116 | Key_Select | Select menu option, checkbox, pressbutton | Required | Not Available |
120 | F31 | Toggle input method | Optional | Optional |
121 | F32 | Sync device | Optional | Optional |
123 | F35 | Toggle backlight | Optional | Optional |
124 | Context1 | First Context button | Optional | Not Available |
125 | Context2 | Second Context button | Optional | Not Available |
126 | Context3 | Third Context button | Optional | Not Available |
127 | Context4 | Fourth Context button | Optional | Not Available |
The following keys are listed below for reasons of compatibility. They do not have default mappings, but should not be used for other purposes.
Qt key code | Description | Keypad Mode | No Keypad Mode |
---|---|---|---|
Key_F30 | maps to space on widgets that need a select key | Not Applicable | Optional |
Key_F33 | maps to enter on widgets that need an Ok key | Not Applicable | Optional |
Key_F34 | Power/Sleep, see also Defining the Power Button | Optional | Required |
Qt Extended is designed to be flexible in terms of the keys required, the default mapping for Qt Extended has the following keys:
Key Name | Description |
---|---|
Key_Select | selects/activates/toggles/edits the currently highlighted item. |
Key_Context1 | soft key 1; mapped to Key_Menu in default mapping. |
Key_Back | leave dialog, or Key_Backspace while editing text and no real Key_Backspace. |
Key_Call | answer or make a call. |
Key_Hangup | hang up a call or return to home screen. |
Key_Up | navigate to previous item, or up one line. |
Key_Down | navigate to next item, or down one line. |
Key_Left | navigate to previous page in Tab Widget, or left one character. |
Key_Right | navigate to next page in Tab Widget, or left one character. |
Key_Flip | pressed and held while the display is closed (eg. Clamshell phone), released when open. Answers calls (on release) and hangs up (on press). |
Key_Backspace | deletes character/item. |
Note: Qt Extended can operate with Key_Menu rather than Key_Context1 and without:
A device may specify in its defaultbutton.conf a power button, see Keypad Button Behavior
If your device does not already have a Qt keyboard driver or it does not emit standard system scancodes then a custom Qt keyboard driver will be required.
Drivers can be added by deriving from the QWSKeyboardHandler and QKbdDriverPlugin classes, using Qt's plug-in mechanism. See the How to Create Qt Plugins documentation and the Plug & Paint example for details.
Sometimes keys are intercepted by the server and so do not reach applications as key events. For example, while the screen lock is active, such as when a SIM card PIN is required, the applications will only be allowed keys such as Key_Back and Key_No. This is to reduce the chance of anyone accessing the phone's data while the SIM-card PIN is still required.
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |