Search code examples
keyboard-shortcutskeymappingmckeymapsmcedit

What are the "a1", "c1" bindings in mc.keymap (Midnight Commander)?


There are such bindings in mc.keymap, which don't describe a meaningful shift-like key combination, but something that looks like a raw character sequence that starts with a letter, and ends with a digit, e.g.:

Top = home; alt-g; a1 # ← the sequence in question, i.e.: "a1"
Bottom = end; alt-shift-g; c1

I wonder what do they describe, i.e.: how are they triggered? What key-combination is, e.g., "c1"?


Solution

  • A1 is the "Home" key on the keypad (numpad 7 with Num Lock turned off), which is decoded as a different key from the regular "Home". Likewise C1 is keypad "End", C1 is keypad "Page Up", C3 is keypad "Page Down", and B2 is documented to "center of keypad", i.e. the 5 key, though I don't know whether any keyboards actually use that. They are documented for the curses library here (search for "keypad").

    Other libraries tend to name these keys something like KP_HOME, KP_END, etc. but curses took a different tack of caring more about the physical layout than the key labels. Midnight commander just inherited this from (n)curses.

    In any case, it should be clear now why the "Top" command would get a default binding for both "home" and "a1" — they are the two keys labeled "Home" on a common PC keyboard.