8000 Raw input related issues · Issue #9409 · libsdl-org/SDL · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Raw input related issues #9409
Open
Open
@cgutman

Description

@cgutman

I noticed a couple issues that seem to be related to the new raw input work as of 4d00706

cc: @slouken

Busy Looping

First, the MsgWaitForMultipleObjects() call doesn't appear to actually be blocking to wait on new raw input messages (or more likely, we're somehow not reading them all off the queue to clear QS_RAWINPUT).

while (!data->done) {
if (MsgWaitForMultipleObjects(1, &data->done_event, FALSE, I 659D NFINITE, QS_RAWINPUT) != (WAIT_OBJECT_0 + 1)) {
break;
}
WIN_PollRawInput(_this);
}

When I stepped through WIN_PollRawInput(), I saw it accumulate events on the first wakeup, then subsequent wakeups seemed to always receive 0 events from GetRawInputBuffer() without resetting QS_RAWINPUT. As a result, MsgWaitForMultipleObjects() instantly returns and we end up in a busy loop. I didn't see anything obviously wrong with any of the code there, so it probably needs more detailed investigation.

I used testgl2.exe from the sdl2-compat repo to reproduce this, but I think it impacts basically any SDL3 program using raw input.

Keyboard Grab

It looks like raw input also interferes with our keyboard hook. The hook is installed successfully, but it doesn't get called while we're registered for raw input. I tried using RIDEV_NOHOTKEYS which worked for blocking the Windows key, but doesn't properly intercept Alt+Tab (and [triggers use of the legacy Alt+Tab UI too).

We could try to carve out a specific exception for raw keyboard input in the case that keyboard grab is enabled and SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED=1 (with the caveat of Windows's RIDEV_NOHOTKEYS Alt+Tab handling not quite behaving as we document that hint should), but I think it's probably easier to just disable raw keyboard input as long as a keyboard grab is active.

To repro, I used testgl2.exe --keyboard-grab and pressed Alt+Tab and Windows key to ensure the grab was working.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0