Skip to content

A way to disable key repeats #310

Closed

Description

@elliegoldstein

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)

Activity

  1. elinorbgr commented on Oct 7, 2017

    @elinorbgr
    Contributor

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

  2. added
    S - api
    on Oct 7, 2017
  3. elliegoldstein commented on Oct 7, 2017

    @elliegoldstein
    ContributorAuthor

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

  4. elinorbgr commented on Oct 8, 2017

    @elinorbgr
    Contributor

    Indeed, I've corrected it. 😅

  5. francesca64 commented on Apr 22, 2018

    @francesca64
    Member

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

  6. added
    H - help wanted
    D - hard
    P - normal
    on May 6, 2018
  7. francesca64 commented on May 15, 2018

    @francesca64
    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?

  8. fschutt commented on Sep 6, 2018

    @fschutt

    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.

  9. francesca64 commented on Sep 11, 2018

    @francesca64
    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.

  10. Osspial commented on Apr 24, 2019

    @Osspial
    Contributor

    Closing in favor of #753 and #812

  11. added a commit that references this issue on Jan 5, 2022
  12. ktnlvr commented on Jun 28, 2023

    @ktnlvr

    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.

  13. kchibisov commented on Jun 28, 2023

    @kchibisov
    Member

    KeyEvent has is_repeat field, so simply ignore repeats.

  14. ktnlvr commented on Jun 29, 2023

    @ktnlvr

    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.

  15. kchibisov commented on Jun 29, 2023

    @kchibisov
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    D - hardH - help wantedP - normalS - api

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions