| 240 | } |
| 241 | |
| 242 | void bindk(const char *key, const char *action, int type) |
| 243 | { |
| 244 | keym *km = findbind(key); |
| 245 | if(!km) |
| 246 | { |
| 247 | string text; |
| 248 | filtertext(text, key, FTXT__AUTOKEYMAPNAME); |
| 249 | int sc = *text && !strcmp(key, text) ? (int)SDL_GetScancodeFromName(text) : SDL_SCANCODE_UNKNOWN; |
| 250 | if(sc != SDL_SCANCODE_UNKNOWN) |
| 251 | { |
| 252 | clientlogf("autokeymap: re-create keymap entry for scancode %d, \"%s\"", sc, text); |
| 253 | sc |= SDLK_SCANCODE_MASK; |
| 254 | keymap(&sc, text); |
| 255 | km = findbind(key); |
| 256 | } |
| 257 | } |
| 258 | if(!km) { conoutf("unknown key \"%s\"", key); return; } |
| 259 | bindkey(km, action, type); |
| 260 | } |
| 261 | |
| 262 | void keybind(const char *key, int type) |
| 263 | { |
no test coverage detected