Skip to content

Do not filter Ctrl+Alt in non-rune cases#749

Merged
gdamore merged 2 commits intogdamore:mainfrom
masmu:bugfix/filter-ctrl-alt-mods
Aug 23, 2025
Merged

Do not filter Ctrl+Alt in non-rune cases#749
gdamore merged 2 commits intogdamore:mainfrom
masmu:bugfix/filter-ctrl-alt-mods

Conversation

@masmu
Copy link
Copy Markdown
Contributor

@masmu masmu commented Sep 30, 2024

Hello, I am currently trying to add additional keybindings in fzf/pull/3996 and in that process I noticed that there is a bug in tcell where Ctrl + Alt modifiers are not set correctly under windows.

Ctrl + Alt seems to be the same as AltGr and AltGr usually switches the keyboard layout to level 3. But this is not true for keys combos like:

  • Ctrl + Alt in conjunction with Up, Down, Left, Right, Home, End, Backspace, Delete, PageUp, PageDown.
  • or mouse clicks.

How to reproduce:

  • First you might need to disable the windows hotkey bindings. (I used method 2, group policy editor)
  • Press Ctrl + Alt + Up
  • Expected key event: Ctrl + Alt + Up
    Actual key event: Up (no mods)

The mods Ctrl and Alt are being filtered out by commit 96e2990.

Ctrl+Alt seems to be the same as AltGr and AltGr usually switches the keyboard layout to level 3.
This is not true for keys combos like:
Ctrl + Alt +
  [Up, Down, Left, Right, Home, End, PageUp, PageDown, Delete, Backspace]
or mouse clicks.
@gdamore
Copy link
Copy Markdown
Owner

gdamore commented Oct 6, 2024

So I confess I'm not sure about this. I can see that for some things like your Ctrl-Alt-Up situation, you might prefer to get keystrokes like that.

I'm not sure how this should happen with other keystrokes though. I need to research a bit more I guess.

@masmu
Copy link
Copy Markdown
Contributor Author

masmu commented Oct 7, 2024

No worries and thank you for looking into this!

I tested that the level 3 behavior remains as it was before for normal keys. Mouse clicks were also affected by that mentioned commit and now got their mods back.

@masmu
Copy link
Copy Markdown
Contributor Author

masmu commented Jul 7, 2025

@gdamore What objections are there regarding other keystrokes? I am happy to help.

tcell not supporting Ctrl + Alt is blocking fzf/pull/3996 and it appears that there is some interest in resolving this issue.

Comment thread console_win.go
@gdamore
Copy link
Copy Markdown
Owner

gdamore commented Aug 23, 2025

I'm not sure why codeql isn't running. I'm going to merge this manually.

@gdamore gdamore merged commit fff1476 into gdamore:main Aug 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants