Skip to content

KeySequenceRecorder: Fix recording the numpad keys

https://bugs.kde.org/show_bug.cgi?id=449642

https://bugs.kde.org/show_bug.cgi?id=430126

https://bugs.kde.org/show_bug.cgi?id=433698

With this fix, shortcuts like „Num+Home” can be entered, but a bug in Qt makes it impossible to trigger the action associated with the shortcut. From qtbase/src/platformsupport/input/xkbcommon/qxkbcommon.cpp:

    // turn off the modifier bits which doesn't participate in shortcuts
    Qt::KeyboardModifiers notNeeded = Qt::KeypadModifier | Qt::GroupSwitchModifier;
    modifiers &= ~notNeeded;

If y'all would rather not wait for the Qt folks to fix that bug (https://bugreports.qt.io/browse/QTBUG-102440), the other way to „fix” this problem in KeySequenceRecorder is to remove Qt::KeypadModifier from the modifierMask variable. Then the numpad Home key will record the „Home” shortcut, just like the other Home key, and they will both trigger the associated action.

I only tested this in Arch Linux. I don't know what the other Qt platforms do with KeypadModifier.

Merge request reports