pynput
pynput copied to clipboard
Add level3_shift special key
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.
Thank you for your pull request.
Does this solve a bug with pynput? pynput.Keyboard.Key.alt_gr
is intended to be usable as ISO_Level3_Shift.
With your test program, I have the following output when pressing and releasing my AltGr key, with a French (Bepo) layout:
alphanumeric key None pressed
<65027> released
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:
æa
This is not the correct output. The correct output should be ææ
with my current layout. So I don't know how to make the key recognized and working with fake inputs. Any idea?