Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added many new X.org keysyms #401

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

precondition
Copy link

@precondition precondition commented Aug 3, 2021

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 #335 and #387.

As I've explained in the comment of another PR (#91 (comment)), I changed the keysym linked to Key.alt_gr to ISO_Level3_Shift.

Key.mic_mute relies on python-xlib/python-xlib#205 getting merged. Otherwise, it simply doesn't do anything so it doesn't hurt to have it

Update: python-xlib/python-xlib#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.

ISO keysyms, meta and hyper modifiers, compose/multi_key, various media controls,
fixes to AltGr and the numpad
iso_emphasize = KeyCode._from_ISO('Emphasize')
iso_center_object = KeyCode._from_ISO('Center_Object')

brightness_up = KeyCode._from_symbol('XF86_MonBrightnessUp')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate that you have added these media and brightness codes, but I will not be able to merge this until matching codes have been added to the remaining backends. I do not mind looking them up though.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By "remaining backends", do you mean recognizingbrightness_up keys on other operating systems as well, like Windows?

@@ -513,7 +574,8 @@ class Listener(ListenerMixin, _base.Listener):
KEYPAD_KEYS['KP_8']: KeyCode.from_char('8'),
KEYPAD_KEYS['KP_9']: KeyCode.from_char('9'),
KEYPAD_KEYS['KP_Add']: KeyCode.from_char('+'),
KEYPAD_KEYS['KP_Decimal']: KeyCode.from_char(','),
KEYPAD_KEYS['KP_Begin']: KeyCode.from_char('Begin'),
KEYPAD_KEYS['KP_Decimal']: KeyCode.from_char('.'),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change highlights an issue with this definition: this depends on the decimal marker used for the input language; on my system, the current definition is correct and this change breaks the library, but I suppose that the current definitions breaks the library for most other systems.

@moses-palmer
Copy link
Owner

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
Copy link

What's the status of this PR?

@moses-palmer
Copy link
Owner

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.

@elibroftw
Copy link

https://codepoints.net/U+2382

A Unicode symbol perhaps?

@precondition
Copy link
Author

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
Copy link
Author

precondition commented Jun 3, 2022

Update: python-xlib/python-xlib#205 was merged on Apr 24!

@elibroftw
Copy link

So can we get this merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants