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

A way to disable key repeats #310

Closed
ryanisaacg opened this issue Oct 7, 2017 · 13 comments
Closed

A way to disable key repeats #310

ryanisaacg opened this issue Oct 7, 2017 · 13 comments
Labels
D - hard Likely harder than most tasks here H - help wanted Someone please save us P - normal Great to have S - api Design and usability

Comments

@ryanisaacg
Copy link
Contributor

At least on Windows, key events seem to respond with a delay (especially when a key is being mashed) due to key repeat handling. Is there any way to disable this?

(Originally I asked in glutin but was referred here)

@elinorbgr
Copy link
Contributor

elinorbgr commented Oct 7, 2017

For the record, the usecase of disabling key repeats is also of interest for smithay, otherwise we would need to filter-out repeated events...

@tomaka tomaka added the S - api Design and usability label Oct 7, 2017
@ryanisaacg
Copy link
Contributor Author

@vberger I think you're missing the ":" in the "https://" of your link

@elinorbgr
Copy link
Contributor

Indeed, I've corrected it. 😅

@francesca64
Copy link
Member

francesca64 commented Apr 22, 2018

We actually can't implement this on X11 without resorting to heuristics, though AFAIK it's straightforward to implement on Windows.

@francesca64 francesca64 added H - help wanted Someone please save us D - hard Likely harder than most tasks here P - normal Great to have labels May 6, 2018
@francesca64
Copy link
Member

It's also easy to implement on macOS. Since there's a precedent for how to handle this on X11, we might as well go for it (though I don't consider it a priority at present).

What's the ideal here? Adding an is_repeat field to KeyboardInput? Or it being configurable to completely strip out repeats? Both?

@fschutt
Copy link

fschutt commented Sep 6, 2018

On windows, key repetition is currently way too fast, I'm not sure what's up with that, if it's a bug or not - is there any way to disable key repetition in winit? It's just because if I type "Hello World", I get "HHeeello WWWorrrrld" because the delay for key repetition is extremely low for some reason.

@francesca64
Copy link
Member

@fschutt I'm not able to reproduce that on Windows 10, though making it possible to filter key repeats would be easy on all platforms other than X11. I'm curious about why that's happening at all, though.

@ghost
Copy link

ghost commented Mar 7, 2019

I'd suggest (without knowing the internals of winit) to add a new ElementState: Repeat.
It can be discarded in the event loop if required.

@Osspial
Copy link
Contributor

Osspial commented Apr 24, 2019

Closing in favor of #753 and #812

@ktnlvr
Copy link

ktnlvr commented Jun 28, 2023

It seems like necroposting, but I've spend a decent amount researching relevant issues with no avail. Perhaps a hacky solution could be outlined at least as a temporary fix? It seems like the proposed bodge solution from GLFW doesn't exactly work, since winit doesn't provide the event timestamps.

@kchibisov
Copy link
Member

KeyEvent has is_repeat field, so simply ignore repeats.

@ktnlvr
Copy link

ktnlvr commented Jun 29, 2023

Am I missing any feature flags? Currently looking at the latest 0.28.6 version and not seeing anything called KeyEvent or similar. There is KeyboardInput, but it doesn't seem to have the is_repeat field.

@kchibisov
Copy link
Member

Yeah, you need winit from master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D - hard Likely harder than most tasks here H - help wanted Someone please save us P - normal Great to have S - api Design and usability
Development

No branches or pull requests

8 participants