Skip to content

AltGr keys produce alt and ctrl modifier on windowsΒ #820

@pascalkuthe

Description

@pascalkuthe

Describe the bug
This issue was first reported in helix-editor/helix#7129 including a reprocutions case. I did some digging there (helix-editor/helix#7129 (comment)) AltGr handling seems a mess on windows but I do think this may be a bug in crossterm.
Disclaimer that i don't have a windows machine or a keyboard that uses altgr at hand myself so I didn't test this myself but the original reproduction case was confirmed by multiple people in helix and we don't do any processing of crossterm key events.

I cameup with the reproduction case below but I can't test it myself:

To Reproduce
Steps to reproduce the behavior:

  1. Open windows terminal
  2. run the event-read exmaple
  3. use a german keyboard layout and press altgr-7 to type {
  4. Observe modifier Alt | Ctrl in the key event (with char {)

Expected behavior
A key event for { without modifier is emitted.

OS
Windows

Terminal/Console
Windows Terminal (stable and preview) and Git Bash (+winpty)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions