moses-palmer / pynput

Sends virtual input commands
GNU Lesser General Public License v3.0
1.79k stars 248 forks source link

Added many new X.org keysyms #401

Open precondition opened 3 years ago

precondition commented 3 years ago

Additions:

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.

moses-palmer commented 3 years ago

Thank you very much for your contribution, and I apologise for the long wait!

I have added a few comments to start a discussion.

elibroftw commented 2 years ago

What's the status of this PR?

moses-palmer commented 2 years ago

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_DiscontinuousUnderline? My initial though is that some of the added keycodes are perhaps a bit too niche.

elibroftw commented 2 years ago

https://codepoints.net/U+2382

A Unicode symbol perhaps?

precondition commented 2 years ago

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.

precondition commented 2 years ago

Update: https://github.com/python-xlib/python-xlib/pull/205 was merged on Apr 24!

elibroftw commented 1 year ago

So can we get this merged?