Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

Keypad Architecture

Introduction

Keypad Architecture

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

Default Scan-codes for Qt Extended Keys

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:

ScancodeQt Key CodeDescriptionKeypad Modeno keypad mode
65Key_MenuApplication menu keyOptionalNot Available
67Key_BackAccept/Close dialog keyRequiredNot Available
68Key_YesYesOptionalNot Available
69Key_NoNoOptionalNot Available
87Key_CallStart call, accept incoming callOptionalNot Available
88Key_HangupEnd call, reject incoming callOptionalNot Available
116Key_SelectSelect menu option, checkbox, pressbuttonRequiredNot Available
120F31Toggle input methodOptionalOptional
121F32Sync deviceOptionalOptional
123F35Toggle backlightOptionalOptional
124Context1First Context buttonOptionalNot Available
125Context2Second Context buttonOptionalNot Available
126Context3Third Context buttonOptionalNot Available
127Context4Fourth Context buttonOptionalNot 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 codeDescriptionKeypad ModeNo Keypad Mode
Key_F30maps to space on widgets that need a select keyNot ApplicableOptional
Key_F33maps to enter on widgets that need an Ok keyNot ApplicableOptional
Key_F34Power/Sleep, see also Defining the Power ButtonOptionalRequired

Qt Extended is designed to be flexible in terms of the keys required, the default mapping for Qt Extended has the following keys:

Key NameDescription
Key_Selectselects/activates/toggles/edits the currently highlighted item.
Key_Context1soft key 1; mapped to Key_Menu in default mapping.
Key_Backleave dialog, or Key_Backspace while editing text and no real Key_Backspace.
Key_Callanswer or make a call.
Key_Hanguphang up a call or return to home screen.
Key_Upnavigate to previous item, or up one line.
Key_Downnavigate to next item, or down one line.
Key_Leftnavigate to previous page in Tab Widget, or left one character.
Key_Rightnavigate to next page in Tab Widget, or left one character.
Key_Flippressed and held while the display is closed (eg. Clamshell phone), released when open. Answers calls (on release) and hangs up (on press).
Key_Backspacedeletes character/item.

Note: Qt Extended can operate with Key_Menu rather than Key_Context1 and without:

Defining the Power Button

A device may specify in its defaultbutton.conf a power button, see Keypad Button Behavior

Overriding the Keyboard Handler Qt Extended Keys

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.

Key Interception

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