You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With Winit v0.29.3 and Windows 11 24H2 build 26100.2605, the key repeat event is slow to be dispatched.
While running a game at 60 FPS, I can see between 20 and 30 frames lag between the keypress event and the keydown event (a keydown event is a pressed event with repeat = true).
A simple reproduction would be :
Create a Rust program with Winit v0.29.3.
Create an event loop.
Inside the callback of EventLoop::run_on_demand, match against key event and print a message. Set control flow to ControlFlow::Pool with EventLoopWindow::set_control_flow, to immediately begin new iteration.
Run the program and press a key but don't release it. You'll see how laggy it is for the second event to pop-in (state = Pressed, repeat = true), while the first event is near instant (state = Pressed, repeat = false). Releasing the key (state = Release, repeat = false) is also instant.
The expected behavior is to get near instant feedback for all of theses events.
Edit : Also, some events are lost while the key is still being hold. To see this in practice, you buffer all the inputs and print the whole buffer inside Event::WindowEvent { event: WindowEvent::RedrawRequested, .. }, and then clear the buffer. Don't forget to add a redraw request inside Event::AboutToWait.
You'll see that some frame have empty input buffer even when the key is hold. I would expect the buffer to be refill between each RedrawRequested since the key is hold, but maybe I'm misunderstandingsome how it should be scheduled.
My setup involve Vulkan, FIFO/MAILBOX and triple buffering. I hope this isn't related because it's not that easy to debug tbh.
I don't know if v0.30 fix this, I'll test later.
Note : probably related, hard to say. The issue surface on both FIFO/MAILBOX on my app - #2127
The text was updated successfully, but these errors were encountered:
With Winit v0.29.3 and Windows 11 24H2 build 26100.2605, the key repeat event is slow to be dispatched.
While running a game at 60 FPS, I can see between 20 and 30 frames lag between the keypress event and the keydown event (a keydown event is a pressed event with repeat = true).
A simple reproduction would be :
EventLoop::run_on_demand
, match against key event and print a message. Set control flow toControlFlow::Pool
withEventLoopWindow::set_control_flow
, to immediately begin new iteration.The expected behavior is to get near instant feedback for all of theses events.
Edit : Also, some events are lost while the key is still being hold. To see this in practice, you buffer all the inputs and print the whole buffer inside
Event::WindowEvent { event: WindowEvent::RedrawRequested, .. }
, and then clear the buffer. Don't forget to add a redraw request insideEvent::AboutToWait
.You'll see that some frame have empty input buffer even when the key is hold. I would expect the buffer to be refill between each
RedrawRequested
since the key is hold, but maybe I'm misunderstandingsome how it should be scheduled.My setup involve Vulkan, FIFO/MAILBOX and triple buffering. I hope this isn't related because it's not that easy to debug tbh.
I don't know if v0.30 fix this, I'll test later.
Note : probably related, hard to say. The issue surface on both FIFO/MAILBOX on my app - #2127
The text was updated successfully, but these errors were encountered: