-
Notifications
You must be signed in to change notification settings - Fork 280
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
AltGr keys produce alt and ctrl modifier on windows #820
Comments
As far as I know that's how windows sends them https://github.com/microsoft/Terminal/blob/660d31ac522186e615ec243de2a434c273464828/src/terminal/input/terminalInput.cpp#L400-L419 I think it's a good idea to check what termwiz do here. |
yeah I am aware, see my liked comment in the helix issue. But that is not really how applications are supposed to interpret it AFAIK (its some legacy stuff as always on windows). The snippet you liked does exactly what i was suggesting: Removing the lctr and ralt modifiers in case they are pressed simultaneously. I am not really aware of windows terminal internals and why they are stripping it there but still sending it trough to the tui (perphaps that code is just for internal keymap handling). Termwiz doesn't seem to handle this altough I am not sure. There seems to be some handling for it but at the wezterm layer rather than inside termwiz |
this is how vim handles this: https://github.com/vim/vim/blob/6ffcc58be32aa1b337bc839cfe173b68cfde7085/src/os_win32.c#L1266 |
Where should I look to tackle this? |
I had a look and I think the fix should take place here Am I right? |
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:
event-read
exmaplealtgr-7
to type{
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)
The text was updated successfully, but these errors were encountered: