pynput
pynput copied to clipboard
Added many new X.org keysyms
Additions:
- All the ISO keysyms
- meta and hyper modifiers
- compose/multi_key
- various media controls like toggle microphone and monitor brightness
- changed AltGr to ISO_Level3_Shift
- KP_Begin
This PR solves a problem of the same kind as https://github.com/moses-palmer/pynput/issues/335 and https://github.com/moses-palmer/pynput/issues/387.
As I've explained in the comment of another PR (https://github.com/moses-palmer/pynput/pull/91#discussion_r681541956), I changed the keysym linked to Key.alt_gr to ISO_Level3_Shift.
Key.mic_mute relies on https://github.com/python-xlib/python-xlib/pull/205 getting merged. Otherwise, it simply doesn't do anything so it doesn't hurt to have it
Update: https://github.com/python-xlib/python-xlib/pull/205 is now merged!
I've also added X.org's meta and hyper modifiers to the list of special keysyms but I'm not sure if there are changes in modifier code that have to be done as well.
❯ xmodmap -pke | grep Meta
keycode 64 = Alt_L Meta_L Alt_L Meta_L Alt_L Meta_L
keycode 205 = NoSymbol Meta_L NoSymbol Meta_L NoSymbol Meta_L
Shift+LAlt produces the Meta_L keysym so this new meta modifier should thus probably be somehow added in pieces of code related to managing the Alt modifier.
Thank you very much for your contribution, and I apologise for the long wait!
I have added a few comments to start a discussion.
What's the status of this PR?
Sorry for this late response.
I have reviewed the changes and now maintain the PR branch locally with minor changes. My only remaining question is the selection of new keys: what is the purpose of keys such as ISO_Discontinuous_Underline? My initial though is that some of the added keycodes are perhaps a bit too niche.
https://codepoints.net/U+2382
A Unicode symbol perhaps?
It's true that keycodes ranging from iso_move_line_up to iso_center_object are very obscure but if we're adding keycodes like iso_level3_shift (AltGr) and iso_left_tab (Shift+Tab), we may as well add the whole slew of ISO keycodes ; it doesn't hurt to have them all.
Update: https://github.com/python-xlib/python-xlib/pull/205 was merged on Apr 24!
So can we get this merged?