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

Function searchbinds

source/src/console.cpp:277–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275}
276
277void 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
292COMMANDF(keybind, "s", (const char *key) { keybind(key, keym::ACTION_DEFAULT); } );
293COMMANDF(keyspecbind, "s", (const char *key) { keybind(key, keym::ACTION_SPECTATOR); } );

Callers 1

console.cppFile · 0.85

Calls 5

resultcharvectorFunction · 0.85
conoutfFunction · 0.70
lengthMethod · 0.45
addMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected