0

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"?

psprint
  • 349
  • 1
  • 10

1 Answers1

1

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.

hobbs
  • 223,387
  • 19
  • 210
  • 288
  • Where from to get any complete listing of the special key codes ("a1", "c3", etc.) meanings? – psprint May 14 '21 at 17:15
  • @psprint the page I linked in my answer seems fine. – hobbs May 15 '21 at 02:20
  • It turns out that the bindings do not work – the bug is hidden as the keypad keys work by returning KEY_HOME, KEY_END, etc. and the mappings expect them too in the same places. Do you maybe know how to distinguish keypad a1 from regular home, etc. with ncurses? https://stackoverflow.com/questions/70206081/ – psprint Dec 02 '21 at 21:01