4 * Key names to keycodes mapping.
14 /* keytable - Mapping of key names to codes, and back. A single code
15 can have more than one name, in which case the first will be used
16 when saving config, but any may be used in setting config. */
18 keytable_t keytable
[] =
31 { "backspace", K_BS
}, /* dup */
33 { "delete", K_DEL
}, /* dup */
35 { "insert", K_INS
}, /* dup */
40 { "pgup", K_PRIOR
}, /* duplicate for pgup/pgdn fans */
41 { "pgdn", K_NEXT
}, /* ditto */
43 { "escape", K_ESC
}, /* dup */
46 { "capslock", K_CAPS
}, /* dup */
47 { "numlock", K_NUMLOCK
},
48 { "scroll", K_SCROLL
},
51 { "_", K_MINUS
}, /* dup */
52 { "equals", K_EQUALS
},
53 { "plus", K_EQUALS
}, /* dup */
54 { "+", K_EQUALS
}, /* dup */
56 { "backquote", K_TILDE
}, /* dup */
57 { "`", K_TILDE
}, /* dup */
59 { "question", K_SLASH
}, /* dup */
60 { "?", K_SLASH
}, /* dup */
61 { "bslash", K_BSLASH
},
62 { "backslash", K_BSLASH
}, /* dup */
63 { "pipe", K_BSLASH
}, /* dup */
64 { "|", K_BSLASH
}, /* dup */
66 { "semicolon", K_SEMI
}, /* dup */
92 { "numplus", K_NUMPLUS
},
93 { "numminus", K_NUMMINUS
},
94 { "nummul", K_NUMMUL
},
95 { "numdiv", K_NUMDIV
},
96 { "numdot", K_NUMDOT
},
97 { "numenter", K_NUMENTER
},
99 /* Note that these are not presently used... */
100 { "mouse0", K_MOUSE0
},
101 { "mouse1", K_MOUSE1
},
102 { "mouse2", K_MOUSE2
},
103 { "mouse3", K_MOUSE3
},
104 { "mouse4", K_MOUSE4
},
106 { "joyleft", K_JOYLEFT
},
107 { "joyright", K_JOYRIGHT
},
108 { "joyup", K_JOYUP
},
109 { "joydown", K_JOYDOWN
},
121 { "joy10", K_JOY10
},
122 { "joy11", K_JOY11
},
123 { "joy12", K_JOY12
},
124 { "joy13", K_JOY13
},
125 { "joy14", K_JOY14
},
126 { "joy15", K_JOY15
},
128 { "xocheck", K_NUM1
},
129 { "xodown", K_NUM2
},
130 { "xocross", K_NUM3
},
131 { "xoleft", K_NUM4
},
132 { "xoright", K_NUM6
},
135 { "xocircle", K_NUM9
},
140 int k_keycode(char *name
)
144 for (key
= keytable
; key
->name
; key
++)
145 if (!strcasecmp(key
->name
, name
))
147 if (strlen(name
) == 1)
148 return tolower(name
[0]);
152 char *k_keyname(int code
)
156 for (key
= keytable
; key
->name
; key
++)
157 if (key
->code
== code
)