Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

Qtopia Core Character Input

When running a Qtopia Core 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 appropiate 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.

Input Widgets
The server process may call the static QWSServer::sendKeyEvent() function at any time. Typically, this is done by popping up a widget that enables the user specify characters with the pointer device.

Note that the key input widget should not take focus since the server would then just send the key events back to the input widget. One way to make sure that the input widget never takes focus is to set the Qt::Tool widget flag in the QWidget constructor.

The Qtopia environment contains various input widgets such as Handwriting Recognition and Virtual Keyboard.

Available Keyboard Drivers

Qtopia Core provides ready-made drivers for the SL5000, Yopy, Vr41XX, console (TTY) and USB protocols. Run the configure script to list the available drivers:

 ./configure -help

Note that the console keyboard driver also 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-s15000

Custom keyboard drivers can be implemented by subclassing the QWSKeyboardHandler class and creating a keyboard driver plugin (derived from the QKbdDriverPlugin class). Qtopia Core's implementation of the QKbdDriverFactory class will automatically detect the plugin, loading the driver into the server application at runtime.

Specifying a Keyboard Driver

To 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> argument are SL5000, Yopy, VR41xx, TTY, USB 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.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Developer Network au hasard

Logo

Comment fermer une application

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

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.2
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 !
 
 
 
 
Partenaires

Hébergement Web