From dfc3db773ac79e33b828b2d2b4a008c8a37cd4e9 Mon Sep 17 00:00:00 2001 From: Daniel Ramoeller Date: Fri, 17 Mar 2023 21:45:36 +0100 Subject: [PATCH] Fixup 89394bcd: handle cursor keys from keypad MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Due to a macOS peculiarity, it is necessary to handle KeypadModifier. We do it unconditionnally, although only macOS seems to be affected. "Note: On macOS, [...] The KeypadModifier value will also be set when an arrow key is pressed as the arrow keys are considered part of the keypad." (​https://doc.qt.io/qt-6/qt.html#KeyboardModifier-enum) Related to bug #12572. --- src/frontends/qt/GuiCommandEdit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontends/qt/GuiCommandEdit.cpp b/src/frontends/qt/GuiCommandEdit.cpp index 89883da50a..a3bf14c9e3 100644 --- a/src/frontends/qt/GuiCommandEdit.cpp +++ b/src/frontends/qt/GuiCommandEdit.cpp @@ -29,7 +29,7 @@ GuiCommandEdit::GuiCommandEdit(QWidget * parent) void GuiCommandEdit::keyPressEvent(QKeyEvent * e) { - if (e->modifiers() == Qt::NoModifier) { + if (e->modifiers() == Qt::NoModifier || e->modifiers() == Qt::KeypadModifier) { switch (e->key()) { case Qt::Key_Escape: // emit signal -- 2.39.5