Commit fe396a51 authored by hjk's avatar hjk
Browse files

fakevim: fix cursor keys on Mac.

On Mac, QKeyEvent::text() returns non-empty strings for cursor keys. This
breaks some of the logic relying on text() being empty for "special" keys.

This is a quick fix to make it usable.
parent b17cd1fd
......@@ -351,6 +351,12 @@ public:
Input(int k, int m, const QString &t)
: m_key(k), m_modifiers(m), m_text(t)
{
// On Mac, QKeyEvent::text() returns non-empty strings for
// cursor keys. This breaks some of the logic later on
// relying on text() being empty for "special" keys.
// FIXME: Check the real conditions.
if (m_text.size() == 1 && m_text.at(0).unicode() < ' ')
m_text.clear();
// m_xkey is only a cache.
m_xkey = (m_text.size() == 1 ? m_text.at(0).unicode() : m_key);
}
......
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