User holding down key - handling #2383
Replies: 2 comments 1 reply
-
"True" |
Beta Was this translation helpful? Give feedback.
-
OK. I ended up keeping a HashSet to track which keys are currently down. It's updated as key events come in. On each scene frame, I check that set to decide what movement is appropriate. It's a workable solution. Winit knows to keep re-sending "Pressed", so it must have some internal info like that. If winit has that info, I'd like to have access to it, rather than duplicating that work. |
Beta Was this translation helpful? Give feedback.
-
For game purposes and for arrow keys, what's the proper Winit way to handle key repeats? Winit will generate a Pressed and Released event. Do I have to track which keys are down, and for how long, or is there something in Winit which will generate repeated events for held-down keys?
Beta Was this translation helpful? Give feedback.
All reactions