Skip to content

Numpad/keypad modifier support #14

@mbdevpl

Description

@mbdevpl

First of all, very nice library! I've been experimenting with it this weekend, and I'd like to use it for my new project (it's gonna be open-source, I'll post a link here after I publish it).

I'm on Ubuntu 20.04, and I've been using shortcuts like Ctrl+Shift+Space or other with no problems at all -- but unfortunately, the numpad keys seem to not be supported at all by pyqtkeybind.

Code (e.g. add this line to your /sample/hotkey.py):

keybinder.register_hotkey(window.winId(), 'Num+0', window.close)

Result (at initialisation time):

Could not find a keycode for Num+0

And then, no reaction on pressing Numpad zero key.

In PyQt, along Qt.ShiftModifier, Qt.ControlModifier etc, there's a Qt.KeypadModifier -- it's useful for catching numpad/keypad events, so keypad number keys like keypad zero etc. can be recognised separately to normal zero key. E.g., Num+0 string is definitely the string for numpad zero.

I'm not sure though on the global keystroke detection side -- is numpad problematic similarly to Win key (i.e. #7) or not... But I doubt OS would get in the way of Numpad keys ;)

I think having access to numpad keys as global shortcuts is quite useful because for those that not use those keys but still have them on the keyboard (my case here), they enable creation of nice one-keystroke shortcuts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions