Keymap: control plane map should be selected even under caps lock

Ctrl+key codes are case insensitive. So pressing Ctrl+x (for instance) or
Ctrl+x under caps lock should works the same.
But when caps lock was on, it was falling back to default map,
producing the char  key instead.

This fix #20052.

Change-Id: I4b36adb3428533454e93ebb3d0a71f4343af9ea7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/11254
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
Philippe Houdoin
2026-07-11 13:58:47 +00:00
parent c807e52c53
commit b4bc72fdc1
+7 -6
View File
@@ -530,10 +530,6 @@ BKeymap::Offset(uint32 keyCode, uint32 modifiers, uint32* _table) const
offset = fKeys.caps_shift_map[keyCode];
table = B_CAPS_SHIFT_TABLE;
break;
case B_CONTROL_KEY:
offset = fKeys.control_map[keyCode];
table = B_CONTROL_TABLE;
break;
case B_OPTION_KEY:
offset = fKeys.option_map[keyCode];
table = B_OPTION_TABLE;
@@ -551,8 +547,13 @@ BKeymap::Offset(uint32 keyCode, uint32 modifiers, uint32* _table) const
table = B_OPTION_CAPS_SHIFT_TABLE;
break;
default:
offset = fKeys.normal_map[keyCode];
table = B_NORMAL_TABLE;
if ((modifiers & B_CONTROL_KEY) != 0) {
offset = fKeys.control_map[keyCode];
table = B_CONTROL_TABLE;
} else {
offset = fKeys.normal_map[keyCode];
table = B_NORMAL_TABLE;
}
break;
}