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

Alt gr not working with icelandic keyboard layout #45

Open
logileifs opened this issue Aug 24, 2017 · 6 comments
Open

Alt gr not working with icelandic keyboard layout #45

logileifs opened this issue Aug 24, 2017 · 6 comments

Comments

@logileifs
Copy link

When using pynput with icelandic keyboard layout Alt_gr gets registered as an unknown key with keycode 65027 but normally the keycode should be 65406. This makes the @ symbol and a few other characters not work since they rely on the Alt_gr.

I've also noticed a similar behavior with Ctrl+Shift+Tab. Tab works, Ctrl+Tab works, Shift+Tab works but when I press Ctrl+Shift+Tab it gets registered as a completely different character (keycode 65056) which isn't even known by pynput. This was very easy to work around though since I could just map that keycode to the Ctrl+Shift+Tab press but unfortunately I can not use the same tactic when Alt_gr is not recognized

@SpecialCharacter
Copy link

Maybe this helps a bit?
#44

@logileifs
Copy link
Author

@SpecialCharacter thanks for the tip but I don't think this will help since I'm not on windows and I was hoping to get a solution that would work with any keyboard layout. I am not reliably able to catch the Alt gr with any layout because it seems to be mapped to a different keycode depending on language layout

@SpecialCharacter
Copy link

@logileifs ok, so we both are looking for a way to make pynput recognize AltGr…

@logileifs
Copy link
Author

logileifs commented Aug 26, 2017

I tried a few different keyboard layouts, German, French and Icelandic, all of them have the AltGr key mapped to 65027. It seems the english layout is the only one (of those) using AltGr as 65406.

The main problem for me though is that this key (65027) gets recognized as an alphanumeric key by pynput so I cannot reliably catch it as a modifier.

@moses-palmer is this something that could be fixed? I'd be happy to make a pull request if you could maybe point me in the right direction

@moses-palmer
Copy link
Owner

I have pushed a partial solution to fixup-xorg-altgr.

This branch simply adds a mapping from ISO_Level3_Shift to AltGr. This solution is not complete; it modifies only the listener part, so attempting to send a lone AltGr will send Mode_switch.

@hou2zi0
Copy link

hou2zi0 commented Mar 27, 2021

Hello, I may have a similar or the same issue using a German qwertz keyboard on Ubuntu 20.04; pynput 1.7.3.
altgr maps onto 65027 for me as well. Parts of the keyboard map fine (normal alphanumeric, shift+number keys), some keys seem to follow the US keyboard layout, e.g. altgr+ü yields @, altgr+'+' yields [, altgr+shift+'+' yields {, altgr+ä yields :, and so on (I attached the expected German layout).
I don't quite know where to go from this :) to me it seems like the layouts are merged somehow, so maybe the problem lies on the level of the OS ... maybe someone has any ideas.
keys

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

No branches or pull requests

4 participants