Commit a2459e0a authored by Arvid Ephraim Picciani's avatar Arvid Ephraim Picciani Committed by con

fakevim: Fix cursor movement in insert mode on Mac.

Reviewed-by: hjk
(cherry picked from commit 51c84911)
parent 06d44df7
...@@ -353,6 +353,9 @@ inline QString msgMarkNotSet(const QString &text) ...@@ -353,6 +353,9 @@ inline QString msgMarkNotSet(const QString &text)
class Input class Input
{ {
public: public:
// Remove some extra "information" on Mac.
static int cleanModifier(int m) { return m & ~Qt::KeypadModifier; }
Input() Input()
: m_key(0), m_xkey(0), m_modifiers(0) {} : m_key(0), m_xkey(0), m_modifiers(0) {}
...@@ -360,7 +363,7 @@ public: ...@@ -360,7 +363,7 @@ public:
: m_key(x.unicode()), m_xkey(x.unicode()), m_modifiers(0), m_text(x) {} : m_key(x.unicode()), m_xkey(x.unicode()), m_modifiers(0), m_text(x) {}
Input(int k, int m, const QString &t) 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 // On Mac, QKeyEvent::text() returns non-empty strings for
// cursor keys. This breaks some of the logic later on // cursor keys. This breaks some of the logic later on
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment