Skip to content

Commit

Permalink
fix Ctrl+AltGr+letter combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
mintty committed Jul 31, 2020
1 parent cf0997a commit 516e7f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/wininput.c
Original file line number Diff line number Diff line change
Expand Up @@ -3040,8 +3040,10 @@ static struct {
when 'A' ... 'Z' or ' ': {
bool check_menu = key == VK_SPACE && !term.shortcut_override
&& cfg.window_shortcuts && alt && !altgr && !ctrl;
// support Ctrl+Shift+AltGr combinations (esp. Ctrl+Shift+@)
bool ctsh = (mods & ~MDK_ALT) == (cfg.ctrl_exchange_shift ? MDK_CTRL : (MDK_CTRL | MDK_SHIFT));
//// support Ctrl+Shift+AltGr combinations (esp. Ctrl+Shift+@)
//bool modaltgr = (mods & ~MDK_ALT) == (cfg.ctrl_exchange_shift ? MDK_CTRL : (MDK_CTRL | MDK_SHIFT));
// support Ctrl+AltGr combinations (esp. Ctrl+@ and Ctrl+Shift+@)
bool modaltgr = ctrl;
#ifdef debug_key
printf("-- mods %X alt %d altgr %d/%d ctrl %d lctrl %d/%d (modf %d comp %d)\n", mods, alt, altgr, altgr0, ctrl, lctrl, lctrl0, term.modify_other_keys, comp_state);
#endif
Expand All @@ -3051,7 +3053,7 @@ static struct {
}
else if (altgr_key())
trace_key("altgr");
else if (!ctsh && !cfg.altgr_is_alt && altgr0 && !term.modify_other_keys)
else if (!modaltgr && !cfg.altgr_is_alt && altgr0 && !term.modify_other_keys)
// prevent AltGr from behaving like Alt
trace_key("!altgr");
else if (key != ' ' && alt_code_key(key - 'A' + 0xA))
Expand Down
1 change: 1 addition & 0 deletions wiki/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Keyboard handling
* Cancel compose key on mouse actions, to prevent surprising character composition.
* Fixed special key assignment (Ctrl+Shift+^) spoiled by KeyFunctions (since 2.9.1).
* Fixed special key assignment (Ctrl+Shift+@ with AltGr) spoiled by AltGrIsAlsoAlt prevention (since 3.1.5).
* Fixed Ctrl+AltGr+letter combinations.
* Fixed key modifier matching for KeyFunctions in some cases of Super/Hyper.

Window handling
Expand Down

0 comments on commit 516e7f0

Please sign in to comment.