Added many more key symbols and names + translations from terminfo

This commit is contained in:
Paul LeoNerd Evans 2008-10-10 01:11:24 +01:00
parent 2ceb64261a
commit bb00cd64b1
3 changed files with 71 additions and 3 deletions

View File

@ -128,20 +128,44 @@ static struct {
/* THIS LIST MUST REMAIN SORTED! */ /* THIS LIST MUST REMAIN SORTED! */
{ "backspace", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_BACKSPACE, 0 }, { "backspace", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_BACKSPACE, 0 },
{ "begin", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_BEGIN, 0 }, { "begin", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_BEGIN, 0 },
{ "beg", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_BEGIN, 0 },
{ "btab", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_TAB, TERMKEY_KEYMOD_SHIFT }, { "btab", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_TAB, TERMKEY_KEYMOD_SHIFT },
{ "cancel", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_CANCEL, 0 },
{ "clear", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_CLEAR, 0 },
{ "close", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_CLOSE, 0 },
{ "command", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_COMMAND, 0 },
{ "copy", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_COPY, 0 },
{ "dc", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_DELETE, 0 }, { "dc", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_DELETE, 0 },
{ "down", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_DOWN, 0 }, { "down", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_DOWN, 0 },
{ "end", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_END, 0 }, { "end", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_END, 0 },
{ "enter", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_ENTER, 0 },
{ "exit", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_EXIT, 0 },
{ "find", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_FIND, 0 }, { "find", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_FIND, 0 },
{ "help", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_HELP, 0 },
{ "home", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_HOME, 0 }, { "home", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_HOME, 0 },
{ "ic", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_INSERT, 0 }, { "ic", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_INSERT, 0 },
{ "left", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_LEFT, 0 }, { "left", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_LEFT, 0 },
{ "mark", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_MARK, 0 },
{ "message", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_MESSAGE, 0 },
{ "move", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_MOVE, 0 },
{ "next", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_PAGEDOWN, 0 }, // Not quite, but it's the best we can do { "next", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_PAGEDOWN, 0 }, // Not quite, but it's the best we can do
{ "npage", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_PAGEDOWN, 0 }, { "npage", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_PAGEDOWN, 0 },
{ "open", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_OPEN, 0 },
{ "options", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_OPTIONS, 0 },
{ "ppage", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_PAGEUP, 0 }, { "ppage", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_PAGEUP, 0 },
{ "previous", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_PAGEUP, 0 }, // Not quite, but it's the best we can do { "previous", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_PAGEUP, 0 }, // Not quite, but it's the best we can do
{ "print", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_PRINT, 0 },
{ "redo", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_REDO, 0 },
{ "reference", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_REFERENCE, 0 },
{ "refresh", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_REFRESH, 0 },
{ "replace", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_REPLACE, 0 },
{ "restart", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_RESTART, 0 },
{ "resume", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_RESUME, 0 },
{ "right", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_RIGHT, 0 }, { "right", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_RIGHT, 0 },
{ "save", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_SAVE, 0 },
{ "select", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_SELECT, 0 }, { "select", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_SELECT, 0 },
{ "suspend", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_SUSPEND, 0 },
{ "undo", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_UNDO, 0 },
{ "up", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_UP, 0 }, { "up", TERMKEY_TYPE_KEYSYM, TERMKEY_SYM_UP, 0 },
{ NULL }, { NULL },
}; };

View File

@ -46,6 +46,28 @@ static struct {
{ TERMKEY_SYM_PAGEDOWN, "PageDown" }, { TERMKEY_SYM_PAGEDOWN, "PageDown" },
{ TERMKEY_SYM_HOME, "Home" }, { TERMKEY_SYM_HOME, "Home" },
{ TERMKEY_SYM_END, "End" }, { TERMKEY_SYM_END, "End" },
{ TERMKEY_SYM_CANCEL, "Cancel" },
{ TERMKEY_SYM_CLEAR, "Clear" },
{ TERMKEY_SYM_CLOSE, "Close" },
{ TERMKEY_SYM_COMMAND, "Command" },
{ TERMKEY_SYM_COPY, "Copy" },
{ TERMKEY_SYM_EXIT, "Exit" },
{ TERMKEY_SYM_HELP, "Help" },
{ TERMKEY_SYM_MARK, "Mark" },
{ TERMKEY_SYM_MESSAGE, "Message" },
{ TERMKEY_SYM_MOVE, "Move" },
{ TERMKEY_SYM_OPEN, "Open" },
{ TERMKEY_SYM_OPTIONS, "Options" },
{ TERMKEY_SYM_PRINT, "Print" },
{ TERMKEY_SYM_REDO, "Redo" },
{ TERMKEY_SYM_REFERENCE, "Reference" },
{ TERMKEY_SYM_REFRESH, "Refresh" },
{ TERMKEY_SYM_REPLACE, "Replace" },
{ TERMKEY_SYM_RESTART, "Restart" },
{ TERMKEY_SYM_RESUME, "Resume" },
{ TERMKEY_SYM_SAVE, "Save" },
{ TERMKEY_SYM_SUSPEND, "Suspend" },
{ TERMKEY_SYM_UNDO, "Undo" },
{ TERMKEY_SYM_KP0, "KP0" }, { TERMKEY_SYM_KP0, "KP0" },
{ TERMKEY_SYM_KP1, "KP1" }, { TERMKEY_SYM_KP1, "KP1" },
{ TERMKEY_SYM_KP2, "KP2" }, { TERMKEY_SYM_KP2, "KP2" },

View File

@ -18,14 +18,12 @@ typedef enum {
TERMKEY_SYM_SPACE, TERMKEY_SYM_SPACE,
TERMKEY_SYM_DEL, TERMKEY_SYM_DEL,
// CSI keys // Special keys
TERMKEY_SYM_UP, TERMKEY_SYM_UP,
TERMKEY_SYM_DOWN, TERMKEY_SYM_DOWN,
TERMKEY_SYM_LEFT, TERMKEY_SYM_LEFT,
TERMKEY_SYM_RIGHT, TERMKEY_SYM_RIGHT,
TERMKEY_SYM_BEGIN, TERMKEY_SYM_BEGIN,
// CSI function keys
TERMKEY_SYM_FIND, TERMKEY_SYM_FIND,
TERMKEY_SYM_INSERT, TERMKEY_SYM_INSERT,
TERMKEY_SYM_DELETE, TERMKEY_SYM_DELETE,
@ -35,6 +33,30 @@ typedef enum {
TERMKEY_SYM_HOME, TERMKEY_SYM_HOME,
TERMKEY_SYM_END, TERMKEY_SYM_END,
// Special keys from terminfo
TERMKEY_SYM_CANCEL,
TERMKEY_SYM_CLEAR,
TERMKEY_SYM_CLOSE,
TERMKEY_SYM_COMMAND,
TERMKEY_SYM_COPY,
TERMKEY_SYM_EXIT,
TERMKEY_SYM_HELP,
TERMKEY_SYM_MARK,
TERMKEY_SYM_MESSAGE,
TERMKEY_SYM_MOVE,
TERMKEY_SYM_OPEN,
TERMKEY_SYM_OPTIONS,
TERMKEY_SYM_PRINT,
TERMKEY_SYM_REDO,
TERMKEY_SYM_REFERENCE,
TERMKEY_SYM_REFRESH,
TERMKEY_SYM_REPLACE,
TERMKEY_SYM_RESTART,
TERMKEY_SYM_RESUME,
TERMKEY_SYM_SAVE,
TERMKEY_SYM_SUSPEND,
TERMKEY_SYM_UNDO,
// Numeric keypad special keys // Numeric keypad special keys
TERMKEY_SYM_KP0, TERMKEY_SYM_KP0,
TERMKEY_SYM_KP1, TERMKEY_SYM_KP1,