From 3f51c30f030a5517273a62bdd48dfe96c98852ee Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Tue, 3 Mar 2009 18:36:58 +0100 Subject: Keymap support for QWS. This patch adds support for keymaps to the QWSKeyboardHandler. The keymaps can be generated by the kmap2qmap tool (see tools/ directory). The source keymaps can be standard Linux .kmap files. Changes to Qt: * completely refactored the Tty and Usb (now known as LinuxInput) handlers * removed the LinuxIS plugin (handled by LinuxInput now) * removed support for iPAQ, EBX and Zylonite keypads (obsolete hardware) * removed support for RAW tty mode. This could be re-added, for non-Linux systems by implementing a PC/AT scan-code to Linux keycode converter. New features for Tty and LinuxInput (ex Usb) handlers: * support for keymaps QWS_KEYBOARD=..:keymap=/path/to/x.qmap:.. * support for dead keys and the compose key * support for lock LEDs * support for key repeat rates (in ms): QWS_KEYBOARD=..:repeat-delay=x:repear-rate=y:.. * the default keymap supports latin1 composing via AltGr: QWS_KEYBOARD=..:enable-compose:.. * ctrl+alt+backspace application zapping can be disabled: QWS_KEYBOARD=..:disable-zap:.. * added virtual filter functions to both the Tty and the LinuxInput handlers. (QWSKeyboardHandler::processKeycode should be virtual in the first place, but that would be BIC) Still missing: * extended documentation for QWS_KEYBOARD Reviewed-By: Paul Olav Tvete Reviewed-By: Harald Fernengel --- src/gui/embedded/qkbd_qws.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/gui/embedded/qkbd_qws.h') diff --git a/src/gui/embedded/qkbd_qws.h b/src/gui/embedded/qkbd_qws.h index 8809f0a5b5..171adc034c 100644 --- a/src/gui/embedded/qkbd_qws.h +++ b/src/gui/embedded/qkbd_qws.h @@ -58,11 +58,33 @@ class Q_GUI_EXPORT QWSKeyboardHandler { public: QWSKeyboardHandler(); + QWSKeyboardHandler(const QString &device); virtual ~QWSKeyboardHandler(); virtual void processKeyEvent(int unicode, int keycode, Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat); + enum KeycodeAction { + None = 0, + + CapsLockOff = 0x01000000, + CapsLockOn = 0x01000001, + NumLockOff = 0x02000000, + NumLockOn = 0x02000001, + ScrollLockOff = 0x03000000, + ScrollLockOn = 0x03000001, + + Reboot = 0x04000000, + + PreviousConsole = 0x05000000, + NextConsole = 0x05000001, + SwitchConsoleFirst = 0x06000000, + SwitchConsoleLast = 0x0600007f, + SwitchConsoleMask = 0x0000007f, + }; + + KeycodeAction processKeycode(quint16 keycode, bool pressed, bool autorepeat); + protected: int transformDirKey(int key); void beginAutoRepeat(int uni, int code, Qt::KeyboardModifiers mod); -- cgit v1.2.1