pynput icon indicating copy to clipboard operation
pynput copied to clipboard

Added many new X.org keysyms

Open precondition opened this issue 4 years ago • 7 comments

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.

precondition avatar Aug 03 '21 09:08 precondition

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

I have added a few comments to start a discussion.

moses-palmer avatar Aug 29 '21 16:08 moses-palmer

What's the status of this PR?

elibroftw avatar Nov 03 '21 15:11 elibroftw

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.

moses-palmer avatar Nov 14 '21 12:11 moses-palmer

https://codepoints.net/U+2382

A Unicode symbol perhaps?

elibroftw avatar Nov 14 '21 14:11 elibroftw

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 avatar Nov 14 '21 20:11 precondition

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

precondition avatar Jun 03 '22 16:06 precondition

So can we get this merged?

elibroftw avatar Jun 21 '23 20:06 elibroftw