]> git.lyx.org Git - features.git/commitdiff
Fixup 89394bcd: handle cursor keys from keypad
authorDaniel Ramoeller <d.lyx@web.de>
Fri, 17 Mar 2023 20:45:36 +0000 (21:45 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 3 May 2023 09:25:06 +0000 (11:25 +0200)
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

index 89883da50a2099b65e68f8873a286a13bda03254..a3bf14c9e316ef178555628be7a96fcc0128c076 100644 (file)
@@ -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