| 228 | COMMANDF(_resetallbinds, "", () { if(_defaultbinds) enumerate(keyms, keym, km, loopj(keym::NUMACTIONS) bindkey(&km, "", j);); }); |
| 229 | |
| 230 | bool bindkey(keym *km, const char *action, int type) |
| 231 | { |
| 232 | if(!km || type < keym::ACTION_DEFAULT || type >= keym::NUMACTIONS) return false; |
| 233 | if(strcmp(action, km->actions[type])) |
| 234 | { |
| 235 | if(!keypressed || keyaction!=km->actions[type]) delete[] km->actions[type]; |
| 236 | km->actions[type] = newstring(action); |
| 237 | km->unchangeddefault[type] = _defaultbinds != 0; |
| 238 | } |
| 239 | return true; |
| 240 | } |
| 241 | |
| 242 | void bindk(const char *key, const char *action, int type) |
| 243 | { |
no test coverage detected