From 85d6e4b0fd871efeaebc1ea91e595d19e2f36a15 Mon Sep 17 00:00:00 2001 From: Garux Date: Tue, 13 Dec 2022 17:32:46 +0600 Subject: [PATCH] shortcuts customization: handle numpad keys as numpad keys --- radiant/commands.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/radiant/commands.cpp b/radiant/commands.cpp index bcf7a327..e5aad5dd 100644 --- a/radiant/commands.cpp +++ b/radiant/commands.cpp @@ -298,10 +298,12 @@ class Single_QKeySequenceEdit : public QKeySequenceEdit protected: void keyPressEvent( QKeyEvent *e ) override { QKeySequenceEdit::keyPressEvent( e ); + if( e->modifiers() & Qt::KeypadModifier ) //. workaround Qt issue: Qt::KeypadModifier is ignored + setKeySequence( QKeySequence( keySequence()[0] | Qt::KeypadModifier ) ); if( QKeySequence_valid( keySequence() ) ) clearFocus(); // trigger editingFinished(); via losing focus 🙉 // because this can still receive focus loss b4 getting deleted (practically because modal msgbox) - // and two editingFinished(); b no good + // and two editingFinished(); b no good } void focusOutEvent( QFocusEvent *event ) override { editingFinished();