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

Fix joystick EV_KEY handling indexing below 0 on keyboard input #2455

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Liam-Malone
Copy link

This fixes an issue I was running into where input from my keyboard running ZMK firmware would be handled as a joystick, and would index the associated keymap with a value less than 0 (code - BTN_MISC, where code was smaller than BTN_MISC).

This issue was causing SIGILL crashes on my laptop every time I used that particular keyboard within my programs using glfw.

@elmindreda elmindreda added Linux Linux specific (any window system) input Keyboard, joystick or mouse labels Jan 4, 2024
@elmindreda elmindreda changed the title Linux: Fix joystick EV_KEY handling indexing below 0 on keyboard input Fix joystick EV_KEY handling indexing below 0 on keyboard input Jan 4, 2024
@elmindreda elmindreda added the bug Bug reports and bugfix pull requests label Feb 4, 2024
@elmindreda
Copy link
Member

Thank you for the bug report! It seems the core issue is that GLFW is treating a keyboard like a joystick in the first place?

@elmindreda elmindreda added the waiting for reply Issues blocked waiting for information label Feb 4, 2024
@Liam-Malone
Copy link
Author

Hi, yes the core issue is my keyboard being treated both as a keyboard and as a joystick.

@elmindreda elmindreda removed the waiting for reply Issues blocked waiting for information label Feb 4, 2024
@elmindreda elmindreda added this to Todo in Queue Feb 4, 2024
@Liam-Malone
Copy link
Author

I will note:
I only did the band-aid fix of preventing indexing below 0, my keyboard still registers as both gamepad and keyboard. This was enough of a fix to permit me to keep working on my own project, but doesn't resolve the core issue.

I have also since tested with another keyboard running QMK firmware and found NO issues with that keyboard. So I can say again that this issue is only occurring on the keyboard that has ZMK firmware, when connected to my laptop.

@elmindreda elmindreda moved this from Todo to Needs Investigation in Queue Feb 5, 2024
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 Linux Linux specific (any window system)
Projects
Queue
Needs Investigation
Development

Successfully merging this pull request may close these issues.

None yet

3 participants