-
Notifications
You must be signed in to change notification settings - Fork 252
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
Add level3_shift special key #91
base: master
Are you sure you want to change the base?
Conversation
In a lot of keyboard (See the output of `grep -r ralt_switch /usr/share/X11/xkb/`), the AltGr is mapped to the ISO_Level3_Shift. I decided to strip the `ISO_` prefix from the member name. Feel free to integrate it if you like.
Thank you for your pull request. Does this solve a bug with pynput? |
With your test program, I have the following output when pressing and releasing my AltGr key, with a French (Bepo) layout:
But since your last comment, I tested the following code: from pynput.keyboard import Key, Controller
keyboard = Controller()
with keyboard.pressed(Key.alt_gr):
keyboard.press('a')
keyboard.release('a')
with keyboard.pressed(Key.level3_shift):
keyboard.press('a')
keyboard.release('a') And I have the following output:
This is not the correct output. The correct output should be |
alt_gr = KeyCode._from_symbol('Mode_switch') | ||
level3_shift = KeyCode._from_symbol('ISO_Level3_Shift') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alt_gr = KeyCode._from_symbol('Mode_switch') | |
level3_shift = KeyCode._from_symbol('ISO_Level3_Shift') | |
alt_gr = KeyCode._from_symbol(''ISO_Level3_Shift') | |
mode_switch = KeyCode._from_symbol('Mode_switch') |
Most xkb layouts in /usr/share/X11/xkb/symbols
by far assign the 'ISO_Level3_Shift
to the right AltGr key. Only digital_vndr/pc
nec_vndr/jp
pk
sun_vndr/tw
and sun_vndr/jp
use Mode_switch
. With that mind, it makes more sense to swap the two.
PS: The alphabetical order is broken with my suggestion so don't hit the "Apply" button. Move mode_switch
between left
and page_down
to preserve the alphabetical order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 90 + double quote ''ISO_Level3_Shift'
In a lot of keyboard layouts (See the output of
grep -r ralt_switch /usr/share/X11/xkb/
), the AltGr is mapped to the ISO_Level3_Shift.I decided to strip the
ISO_
prefix from the member name. Feel free to integrate it if you like.