MCPcopy Create free account
hub / github.com/assaultcube/AC / bindkey

Function bindkey

source/src/console.cpp:230–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228COMMANDF(_resetallbinds, "", () { if(_defaultbinds) enumerate(keyms, keym, km, loopj(keym::NUMACTIONS) bindkey(&km, "", j);); });
229
230bool 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
242void bindk(const char *key, const char *action, int type)
243{

Callers 4

keyMethod · 0.85
console.cppFile · 0.85
bindkFunction · 0.85
bindcFunction · 0.85

Calls 1

newstringFunction · 0.85

Tested by

no test coverage detected