patch 9.0.1302: on a Belgian keyboard CTRL-] does not work
Problem: On a Belgian keyboard CTRL-] does not work.
Solution: Translate CTRL-$ into CTRL-]. (closes #11831)
diff --git a/src/misc2.c b/src/misc2.c
index e3602ee..6133a5e 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -1543,7 +1543,7 @@
int
may_adjust_key_for_ctrl(int modifiers, int key)
{
- if (!(modifiers & MOD_MASK_CTRL))
+ if ((modifiers & MOD_MASK_CTRL) == 0)
return key;
if (ASCII_ISALPHA(key))
@@ -1559,6 +1559,13 @@
return '^';
if (key == '-')
return '_';
+
+ // On a Belgian keyboard AltGr $ is ']', on other keyboards '$' can only be
+ // obtained with Shift. Assume that '$' without shift implies a Belgian
+ // keyboard, where CTRL-$ means CTRL-].
+ if (key == '$' && (modifiers & MOD_MASK_SHIFT) == 0)
+ return ']';
+
return key;
}