我想在 Midnight Commander 中为按键绑定分配一些操作,例如Alt+[或Alt+ ]。
我在哪里可以找到此按键(和其他按键)的“代号”?
例如,我已经找到了一些按键:
`=“prime”
{=“lbrace”
}=“rbrace”
<=“lt”
>=“gt”
谢谢。
答案1
grep Midnight Commander 源代码,您要查看的文件是“lib/tty/keys.c”,相关部分注释为“替代标签”
这是相关部分,后面是该项目官方 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