| Home · All Classes · Grouped Classes · Annotated · Functions |
For an overview on character input in Qtopia Core see : Qtopia Core Character Input.
For a tutorial discussing adding a keyboard driver plug-in see : Tutorial: Implementing a Device Plug-in
Nearly all PDAs and Phones have keys that are not found on a regular keyboard. In order for Qtopia 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 Qtopia.
In addition to the normal mapping for a 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 |
| "122" | F34 | Power/Sleep | Optional | Required |
| "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 |
Two additional keys are listed below for reasons of compatibility. They do not have default mappings, and should not be used.
| 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 |
Qtopia is designed to be flexible in terms of the keys required, the default mapping for Qtopia 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 or hangs up calls. |
| Key_Backspace | deletes character/item. |
Note: Qtopia can operate with Key_Menu rather than Key_Contex and without:
Trolltech will endeavor to provide assistance for alternate device button mappings.
If your device does not already have a Qt keyboard driver or it does not emit standard scancodes then a custom Qt keyboard driver will be required.
Drivers can be added by deriving from the QWSMouseHandler and QMouseDriverPlugin classes, or the QWSKeyboardHandler and QKbdDriverPlugin classes, and using Qt's plug-in mechanism. See the How to Create Qt Plugins documentation and the Plug & Paint example for details.
Some keys are always intercepted before they reach an application. If a pointer device is available an application perform a keyboard grab to obtain these keys.
While the screen lock is active, for example 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 © 2007 Trolltech | Trademarks | Qtopia 4.2.5 |