diff options
author | Gatis Paeglis <gatis.paeglis@theqtcompany.com> | 2014-10-23 14:45:18 +0200 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@digia.com> | 2014-10-27 15:19:02 +0100 |
commit | 2b666d9576210aa98700e219dba6b1bd4f93d793 (patch) | |
tree | 07ed6da88b28d9e68818d422595a1650ab161b94 /src/plugins/platforms/xcb/qxcbkeyboard.h | |
parent | cc1435952d796476616f54319c1ddf57eeaf80f7 (diff) |
Fix shortcut handling with non-latin layouts
Shortcut handling with non-latin keyboard layouts
were broken for checks like:
QKeyEvent key = ...;
key == QKeySequence::SelectAll
In Qt4 this was handled transparently when getting
keysym from XLookupString. When ctrl modifier was set,
XLookupString performed "keysym transformation" to obtain
a latin keysym. Still this did not solve the non-latin
shortcut issues for all cases due to some of Xlib
assumptions which could not be controled by user.
This patch implements XLookupString-like behavior
in lookupLatinKeysym(). It is not a 1-to-1 copy of how
XLookupString perfoms latin keysym lookup, but it
serves our needs just fine. lookupLatinKeysym() also
handles the cases that did not work in Qt4 with
XLookupString, thanks to libxkbcommon keymap query API.
And lookupLatinKeysym() replaces the fragile implementation
of "fallback latin key" code path in possibleKeys().
Done-with: Ruslan Nigmatullin
Task-number: QTBUG-33182
Task-number: QTBUG-32274
Change-Id: I56a5b624487ca6c2c3768220301a37dac39b439a
Reviewed-by: Ruslan Nigmatullin <euroelessar@yandex.ru>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbkeyboard.h')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbkeyboard.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.h b/src/plugins/platforms/xcb/qxcbkeyboard.h index e71165d824..9f1cf165cb 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.h +++ b/src/plugins/platforms/xcb/qxcbkeyboard.h @@ -91,6 +91,9 @@ protected: void updateVModMapping(); void updateVModToRModMapping(); + xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; + void checkForLatinLayout(); + private: bool m_config; xcb_keycode_t m_autorepeat_code; @@ -99,6 +102,7 @@ private: struct xkb_keymap *xkb_keymap; struct xkb_state *xkb_state; struct xkb_rule_names xkb_names; + mutable struct xkb_keymap *latin_keymap; struct _mod_masks { uint alt; @@ -128,6 +132,7 @@ private: _mod_masks vmod_masks; int core_device_id; #endif + bool m_hasLatinLayout; }; QT_END_NAMESPACE |