| 275 | } |
| 276 | |
| 277 | void searchbinds(const char *action, int type) |
| 278 | { |
| 279 | if(!action || !action[0]) return; |
| 280 | if(type < keym::ACTION_DEFAULT || type >= keym::NUMACTIONS) { conoutf("invalid bind type \"%d\"", type); return; } |
| 281 | vector<char> names; |
| 282 | enumerate(keyms, keym, km, |
| 283 | if(!strcmp(km.actions[type], action)) |
| 284 | { |
| 285 | if(names.length()) names.add(' '); |
| 286 | names.put(km.name, strlen(km.name)); |
| 287 | } |
| 288 | ); |
| 289 | resultcharvector(names, 0); |
| 290 | } |
| 291 | |
| 292 | COMMANDF(keybind, "s", (const char *key) { keybind(key, keym::ACTION_DEFAULT); } ); |
| 293 | COMMANDF(keyspecbind, "s", (const char *key) { keybind(key, keym::ACTION_SPECTATOR); } ); |
no test coverage detected