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

Linux and X11 and xmodmap, no longer remaps keys. #2011

Open
songsofsyx opened this issue Dec 14, 2021 · 2 comments
Open

Linux and X11 and xmodmap, no longer remaps keys. #2011

songsofsyx opened this issue Dec 14, 2021 · 2 comments
Labels
bug Bug reports and bugfix pull requests input Keyboard, joystick or mouse X11

Comments

@songsofsyx
Copy link

When I updated GLFW to 3.3.5 a linux user reported that his key rebindings weren't working anymore. Caps Lock was being mapped to Ctrl, and this worked in prior versions of GLFW, but has now stopped, and all keys are now what they are.

The GLFWKeyCallback will have
key = actual key

While expected behaviour would be was that the key was remapped through xmodmap.

@linkmauve linkmauve added bug Bug reports and bugfix pull requests input Keyboard, joystick or mouse X11 labels Dec 14, 2021
@kaadmy
Copy link

kaadmy commented Dec 17, 2021

I ran into this issue a while back, at some point in the past. If I understand correctly, GLFW now uses Xkb to handle key mappings, and Xmodmap no longer works. Instead I switched to using setxkbmap instead of Xmodmap for my personal setup, since apparently Xmodmap is deprecated now.

@0
Copy link

0 commented Jul 2, 2022

This change was introduced in b25ee39 to fix the issue described in #1598, and first released in version 3.3.3. It affects both keys remapped with xmodmap and with XKB.

Previously, some keys (including modifier keys, like control) would be translated to keysyms, taking into account configured mappings. The key identities are now accessed directly, and based on the comment in the current version of x11_init.c, this appears to be the intended behavior. That makes sense for applications where the user wants to bind a specific keyboard key to a particular action, regardless of the usual meaning of that key.

The correct approach is probably to check the modifier bits instead, as those are still being set with the current layout in mind. Unfortunately, there doesn't seem to be a general way to get the modifier state from GLFW.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports and bugfix pull requests input Keyboard, joystick or mouse X11
Projects
None yet
Development

No branches or pull requests

3 participants