-
-
Notifications
You must be signed in to change notification settings - Fork 619
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
input: handle remapped keys on x11 #2974
Comments
Does this work with GLFW? |
Yes I replicated the same issue in GLFW, if I run the gears example then when I press the capslock key nothing happens, but when I press the physical escape key then the gears program will quit. The gears code has
But I also have the same issue when I run my game in a web browser via wasm. I would have thought that the browser would handle key remappings correctly. I guess there is little that ebiten can do about the situation with the browser. |
Ebitengine Version
2.7.2
Operating System
Go Version (
go version
)go version go1.22.2 linux/amd64
What steps will reproduce the problem?
Swap escape and capslock with this command
press the capslock key in the game, and then invoke inpututil.AppendPressedKeys(keys).
What is the expected result?
The keys array should contain ebiten.KeyEscape, but instead it contains ebiten.KeyCapsLock
What happens instead?
Keys array contains ebiten.KeyCapsLock
Anything else you feel useful to add?
This situation works in SDL2, when I press the capslock key the key event correctly has event.key.keysym.sym == SDLK_ESCAPE.
Maybe the issue is in how the glfx.x11.keycodes array is set up, although the code looks plausible in that it queries xkb.
ebiten/internal/glfw/x11_init_linbsd.c
Line 197 in 13d15b0
FWIW this is what
xev -event keyboard
shows for me (after having swapped escape and capslock with the command above)Press capslock:
Press escape:
The text was updated successfully, but these errors were encountered: