Skip to content
Myr

fix(windows): coninput not handling control sequences (#1041)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Thanks @robotastronaut for sharing their research in the Charm Discord server and for the initial fix. In contrast to their fix, this should fully align with the key handling on Unix and fix other issues like Shift+Tab not working on Windows.

authored by Sculas · committed by GitHub · parent ab28057 · Browse files · 1 file+12 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+12 added−2 removed

  • other:+12 added−2 removed

1 file+12 added−2 removed

modified:key_windows.go+12 added-2 removed
37 unmodified lines
38 continue39 }4041 for i := 0; i < int(e.RepeatCount); i++ {42 eventKeyType := keyType(e)43 var runes []rune4445 // Add the character only if the key type is an actual character and not a control sequence.46 // This mimics the behavior in readAnsiInputs where the character is also removed.47 // We don't need to handle KeySpace here. See the comment in keyType().48 if eventKeyType == KeyRunes {49 runes = []rune{e.Char}50 }5152 msgs = append(msgs, KeyMsg{43 Type: keyType(e),44 Runes: []rune{e.Char},53 Type: eventKeyType,54 Runes: runes,55 Alt: e.ControlKeyState.Contains(coninput.LEFT_ALT_PRESSED | coninput.RIGHT_ALT_PRESSED),56 })57 }58 case coninput.WindowBufferSizeEventRecord:
293 unmodified lines