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

SDL3: Enable raw keyboard on Windows #6507

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

Conversation

Susko3
Copy link
Member

@Susko3 Susko3 commented Jan 23, 2025

Related:

With #6506, this will handle keyboard events on a dedicated thread to bypass the usual SDL event flow, leading to lower latency and immunity from main thread lag (we sometimes see SDL_PumpEvents() take a long time). Mouse input is already handled on this dedicated thread when relative mouse mode is enabled.

This PR is blocked as it breaks disabling the windows key during gameplay in osu!. Raw keyboard input will bypass the hook that is supposed to disable the windows key. I found some plausible workaround for this, but they are very hacky and might increase latency.

Enabling raw keyboard may lead to timing issues wrt TextBox text input & related handling. This PR needs to be tested to check for IME regressions.

@Susko3 Susko3 changed the title SDL3: Enabled raw keyboard on Windows SDL3: Enable raw keyboard on Windows Jan 23, 2025
@peppy peppy self-requested a review January 24, 2025 07:22
@Susko3
Copy link
Member Author

Susko3 commented Jan 24, 2025

Keep in mind that the hint can be toggled while the game is running. So if some issue is a deal-breaker, we can just toggle the hint off as needed. Example: if someone has a gaming keyboard that can disable the windows key in hardware, they don't need our software solution, so they would only benefit from raw keyboard.

https://wiki.libsdl.org/SDL3/SDL_HINT_WINDOWS_RAW_KEYBOARD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant