In keymap, I duplicated and modified “Apple Aluminium Extended International” in order to make the mapping exactly as the keyboard I’m using.
However, I noticed that no matter which keyboard layout I choose, I get in trouble when having Caps Lock enabled and holding down Control. It’s easiest to observe in the Terminal running nano:
Open the terminal, type ‘nano’
Press Caps Lock, so it’s on, now hold down Control and press ‘x’.
Instead of exiting nano, an ‘x’ is going to the file.
-No matter which keyboard layout I use, I get this problem, is there a way to fix it, or should I file a bug-report ?
(Bug 20052 seems to touch the problem, but I’m not sure it’s the exact same problem)
It is indeed the same problem as 20052. Some (but not all) keymaps do not define the right values for shift+control (and caps+control which is the same).
I didn’t have time to go over all keymaps and replace the shift+control layer with the control characters from the base control layer.
You are mixing up keymaps and keyboard layout definitions. These do absolutely nothing except change how the keys are shown in keymap preferences.
The keymaps are for different languages.
But other than that, you’re right, the problem is not solvable at the keymap level as I thought. It’s rather a matter of priorities between modifiers: control should override caps lock, but currently the opposite happens. So that will need a change in the code, apparently.
I completely agree; control needs highest priority.
I think it’s great, that we’re able to assign our own control-codes to each key; especially in case a key has a unicode code point, we’d still be able to output 0x01 on that key (or even special symbols).
Sorry about the mixup; Yes, keymapping is ‘what’ a key does, layout is ‘where’ the key is located (and is completely unrelated.
Well, I guess it’s due to src/kits/shared/keymap.cpp , in BKeymap::Offset() which support only these modifiers combinaison:
shift
caps lock
shift + caps lock
control
option
option + shift
option + caps lock
option + caps lock + shift
default mapping
Control + caps lock is not explicitly catched, therefore when Control + x is pressed while caps lock is also on, it fall on default mapping => “x” (lowercase).
We all face similar “small but important/annoying to me” edge-cases from time to time
I remember hitting an issue with mount_server (where it incorrectly remembered previously mounted partitions… if you happened to have to very similar ones). Annoyed me enough to fix it myself, send a patch, and then, as my solution was subpar… pester @waddlesplash into writing an acceptable solution (sorry, and thanks again there Augustin!).
Thanks you for taking the time to report the issue, opening a ticket (even if it was a duplicate), because in the end it is what bring this issue again in the spotlight and triggered the curiosity of someone to try to find its root cause.