diff options
author | Robert Griebl <rgriebl@trolltech.com> | 2009-03-03 17:36:58 (GMT) |
---|---|---|
committer | Robert Griebl <rgriebl@trolltech.com> | 2009-04-02 19:21:57 (GMT) |
commit | 3f51c30f030a5517273a62bdd48dfe96c98852ee (patch) | |
tree | aa40f43a4d2d0b8e68b8b4ebbd86113bc8bc4f60 /src/gui/embedded/qkbd_qws_p.h | |
parent | 86723ca856dbd07bc7809ed9c3f9a219a99e67bd (diff) | |
download | Qt-3f51c30f030a5517273a62bdd48dfe96c98852ee.zip Qt-3f51c30f030a5517273a62bdd48dfe96c98852ee.tar.gz Qt-3f51c30f030a5517273a62bdd48dfe96c98852ee.tar.bz2 |
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
Diffstat (limited to 'src/gui/embedded/qkbd_qws_p.h')
-rw-r--r-- | src/gui/embedded/qkbd_qws_p.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/src/gui/embedded/qkbd_qws_p.h b/src/gui/embedded/qkbd_qws_p.h new file mode 100644 index 0000000..f7dcdaf --- /dev/null +++ b/src/gui/embedded/qkbd_qws_p.h @@ -0,0 +1,77 @@ +#ifndef QWSKEYBOARD_P_H +#define QWSKEYBOARD_P_H + +#include <QDataStream> + +namespace QWSKeyboard { + const quint32 FileMagic = 0x514d4150; // 'QMAP' + + struct Mapping { + quint16 keycode; + quint16 unicode; + quint32 qtcode; + quint8 modifiers; + quint8 flags; + quint16 special; + + }; + + enum Flags { + IsDead = 0x01, + IsLetter = 0x02, + IsModifier = 0x04, + IsSystem = 0x08, + }; + + enum System { + SystemConsoleFirst = 0x0100, + SystemConsoleMask = 0x007f, + SystemConsoleLast = 0x017f, + SystemConsolePrevious = 0x0180, + SystemConsoleNext = 0x0181, + SystemReboot = 0x0200, + SystemZap = 0x0300, + }; + + struct Composing { + quint16 first; + quint16 second; + quint16 result; + }; + + enum Modifiers { + ModPlain = 0x00, + ModShift = 0x01, + ModAltGr = 0x02, + ModControl = 0x04, + ModAlt = 0x08, + ModShiftL = 0x10, + ModShiftR = 0x20, + ModCtrlL = 0x40, + ModCtrlR = 0x80, + // ModCapsShift = 0x100, // not supported! + }; +}; + +inline QDataStream &operator>>(QDataStream &ds, QWSKeyboard::Mapping &m) +{ + return ds >> m.keycode >> m.unicode >> m.qtcode >> m.modifiers >> m.flags >> m.special; +} + +inline QDataStream &operator<<(QDataStream &ds, const QWSKeyboard::Mapping &m) +{ + return ds << m.keycode << m.unicode << m.qtcode << m.modifiers << m.flags << m.special; +} + +inline QDataStream &operator>>(QDataStream &ds, QWSKeyboard::Composing &c) +{ + return ds >> c.first >> c.second >> c.result; +} + +inline QDataStream &operator<<(QDataStream &ds, const QWSKeyboard::Composing &c) +{ + return ds << c.first << c.second << c.result; +} + + +#endif // QWSKEYBOARD_H |