Skip to content

Add support for DECARM (Auto Repeat Mode) #13919

@j4james

Description

@j4james

Description of the new feature/enhancement

Auto Repeat Mode controls whether a keypress automatically repeats if you keep it held down for long enough. Technically it's a level 1 conformance requirement, and has been supported on every DEC terminal from the VT100 onwards.

My personal use case was for a game I was working on, where holding down a key for too long could end up generating spurious keypresses, and the hero would accidentally throw themselves off the edge of a cliff. Being able to disable the auto repeat makes that less of an issue.

Proposed technical implementation details (optional)

Every time we receive a keydown event, we record the virtual key code to track that as the last key pressed. If we receive a keyup event the matches that last key code, we reset that field. Then if the auto repeat mode is reset, and we receive a keydown event that matches the last key code, we simply ignore it.

This approach works great in conhost, but not so well in Windows Terminal (because of issue #8440). It does work for the arrow keys, though, which is my primary use case. So the question is, would you be happy to accept a PR for this, even if it doesn't fully work in Windows Terminal? Or do we need to fix #8440 first?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-VTVirtual Terminal sequence supportHelp WantedWe encourage anyone to jump in on these.Issue-TaskIt's a feature request, but it doesn't really need a major design.Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meetingProduct-ConhostFor issues in the Console codebaseProduct-TerminalThe new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions