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

Function bindk

source/src/console.cpp:242–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242void 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
262void keybind(const char *key, int type)
263{

Callers 1

console.cppFile · 0.85

Calls 6

findbindFunction · 0.85
filtertextFunction · 0.85
clientlogfFunction · 0.85
keymapFunction · 0.85
bindkeyFunction · 0.85
conoutfFunction · 0.70

Tested by

no test coverage detected