diff options
author | Arvid Ephraim Picciani <arvid.picciani@nokia.com> | 2010-11-02 12:37:36 +0100 |
---|---|---|
committer | con <qtc-committer@nokia.com> | 2010-12-13 16:50:44 +0100 |
commit | a2459e0abebd49a1e84d55dc5ff01186ff7e85c2 (patch) | |
tree | 9d66a5eec1fe8239463b728fd8813d0858c2fb00 | |
parent | 06d44df7319dca4aa4837e0965457d812d9dec02 (diff) | |
download | qt-creator-a2459e0abebd49a1e84d55dc5ff01186ff7e85c2.tar.gz |
fakevim: Fix cursor movement in insert mode on Mac.
Reviewed-by: hjk
(cherry picked from commit 51c8491158f3c7b880c169cd6602643c5dc0c153)
-rw-r--r-- | src/plugins/fakevim/fakevimhandler.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index cd327bb7b3..45e22a3c07 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -353,6 +353,9 @@ inline QString msgMarkNotSet(const QString &text) class Input { public: + // Remove some extra "information" on Mac. + static int cleanModifier(int m) { return m & ~Qt::KeypadModifier; } + Input() : m_key(0), m_xkey(0), m_modifiers(0) {} @@ -360,7 +363,7 @@ public: : m_key(x.unicode()), m_xkey(x.unicode()), m_modifiers(0), m_text(x) {} Input(int k, int m, const QString &t) - : m_key(k), m_modifiers(m), m_text(t) + : m_key(k), m_modifiers(cleanModifier(m)), m_text(t) { // On Mac, QKeyEvent::text() returns non-empty strings for // cursor keys. This breaks some of the logic later on |