Qt for Embedded Linux Character InputWhen running a Qt for Embedded Linux application, it either runs as a server or connects to an existing server. The keyboard driver is loaded by the server application when it starts running, using Qt's plugin system. Internally in the client/server protocol, all system generated events, including key events, are passed to the server application which then propagates the event to the appropriate client. Note that key events do not always come from a keyboard device, they can can also be generated by the server process using input widgets.
Available Keyboard DriversQt for Embedded Linux provides ready-made drivers for the console (TTY) and the standard Linux Input Subsystem (USB, PS/2, ...). Run the configure script to list the available drivers: ./configure -help Note that only the console (TTY) keyboard driver handles console switching (Ctrl+Alt+F1, ..., Ctrl+Alt+F10) and termination (Ctrl+Alt+Backspace). In the default Qt configuration, only the "TTY" driver is enabled. The various drivers can be enabled and disabled using the configure script. For example: configure -qt-kbd-linuxinput Custom keyboard drivers can be implemented by subclassing the QWSKeyboardHandler class and creating a keyboard driver plugin (derived from the QKbdDriverPlugin class). The default implementation of the QKbdDriverFactory class will automatically detect the plugin, loading the driver into the server application at run-time. KeymapsStarting with 4.6, Qt for Embedded Linux has gained support for user defined keymaps. Keymap handling is supported by the built-in keyboard drivers TTY and LinuxInput. Custom keyboard drivers can use the existing keymap handling code via QWSKeyboardHandler::processKeycode(). By default Qt will use an internal, compiled-in US keymap. See the options below for how to load a different keymap. Specifying a Keyboard DriverTo specify which driver to use, set the QWS_KEYBOARD environment variable. For example (if the current shell is bash, ksh, zsh or sh): export QWS_KEYBOARD=<driver>[:<driver specific options>] The <driver> arguments are TTY, LinuxInput and keys identifying custom drivers, and the driver specific options are typically a device, e.g., /dev/tty0. Multiple keyboard drivers can be specified in one go: export QWS_KEYBOARD="<driver>[:<driver specific options>] <driver>[:<driver specific options>] <driver>[:<driver specific options>]" Input will be read from all specified drivers. Currently the following options are supported by both the TTY and LinuxInput driver:
|
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.8 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com