Where can I find keyboard key names using in mc.keymap?

1

I want to assign some actions to key bindnigs in Midnight Commander like Alt+[ or Alt+].
Where can I find "code names" for this (and other) keys?
For example I already found some keys:
` = "prime"
{ = "lbrace"
} = "rbrace"
< = "lt"
> = "gt"

Thanks.

Mikel Vysotsky

Posted 2016-02-16T18:21:48.310

Reputation: 53

Answers

1

grep'ing the Midnight Commander source code, the file you want to look over is 'lib/tty/keys.c', with the relevant section commented "Alternative label"

Here is the relevant section, followed by a link to the file at the project's official repo.

/* Alternative label */
{ESC_CHAR, "esc", N_("Escape"), "Esc"},
{KEY_BACKSPACE, "bs", N_("Backspace"), "Bakspace"},
{KEY_IC, "ins", N_("Insert"), "Ins"},
{KEY_DC, "del", N_("Delete"), "Del"},
{(int) '*', "asterisk", N_("Asterisk"), "*"},
{(int) '-', "minus", N_("Minus"), "-"},
{(int) '+', "plus", N_("Plus"), "+"},
{(int) '.', "dot", N_("Dot"), "."},
{(int) '<', "lt", N_("Less than"), "<"},
{(int) '>', "gt", N_("Great than"), ">"},
{(int) '=', "equal", N_("Equal"), "="},
{(int) ',', "comma", N_("Comma"), ","},
{(int) '\'', "apostrophe", N_("Apostrophe"), "\'"},
{(int) ':', "colon", N_("Colon"), ":"},
{(int) ';', "semicolon", N_("Semicolon"), ";"},
{(int) '!', "exclamation", N_("Exclamation mark"), "!"},
{(int) '?', "question", N_("Question mark"), "?"},
{(int) '&', "ampersand", N_("Ampersand"), "&"},
{(int) '$', "dollar", N_("Dollar sign"), "$"},
{(int) '"', "quota", N_("Quotation mark"), "\""},
{(int) '%', "percent", N_("Percent sign"), "%"},
{(int) '^', "caret", N_("Caret"), "^"},
{(int) '~', "tilda", N_("Tilda"), "~"},
{(int) '`', "prime", N_("Prime"), "`"},
{(int) '_', "underline", N_("Underline"), "_"},
{(int) '_', "understrike", N_("Understrike"), "_"},
{(int) '|', "pipe", N_("Pipe"), "|"},
{(int) '(', "lparenthesis", N_("Left parenthesis"), "("},
{(int) ')', "rparenthesis", N_("Right parenthesis"), ")"},
{(int) '[', "lbracket", N_("Left bracket"), "["},
{(int) ']', "rbracket", N_("Right bracket"), "]"},
{(int) '{', "lbrace", N_("Left brace"), "{"},
{(int) '}', "rbrace", N_("Right brace"), "}"},
{(int) '\n', "enter", N_("Enter"), "Enter"},
{(int) '\t', "tab", N_("Tab key"), "Tab"},
{(int) ' ', "space", N_("Space key"), "Space"},
{(int) '/', "slash", N_("Slash key"), "/"},
{(int) '\\', "backslash", N_("Backslash key"), "\\"},
{(int) '#', "number", N_("Number sign #"), "#"},
{(int) '#', "hash", N_("Number sign #"), "#"},
/* TRANSLATORS: Please translate as in "at sign" (@). */
{(int) '@', "at", N_("At sign"), "@"},

http://repo.or.cz/midnight-commander.git/blob/HEAD:/lib/tty/key.c

notdavidcronenberg

Posted 2016-02-16T18:21:48.310

Reputation: 531