[LyX/master] Fixup 89394bcd: handle cursor keys from keypad

Jean-Marc Lasgouttes lasgouttes at lyx.org
Wed May 3 08:18:05 UTC 2023


commit dfc3db773ac79e33b828b2d2b4a008c8a37cd4e9
Author: Daniel Ramoeller <d.lyx at web.de>
Date:   Fri Mar 17 21:45:36 2023 +0100

    Fixup 89394bcd: handle cursor keys from keypad
    
    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 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/frontends/qt/GuiCommandEdit.cpp b/src/frontends/qt/GuiCommandEdit.cpp
index 89883da..a3bf14c 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


More information about the lyx-cvs mailing list