MCPcopy Create free account
hub / github.com/ddnet/ddnet / PossibleKeys

Function PossibleKeys

src/game/client/components/console.cpp:164–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164static int PossibleKeys(const char *pStr, IInput *pInput, IConsole::FPossibleCallback pfnCallback = IConsole::EmptyPossibleCommandCallback, void *pUser = nullptr)
165{
166 int Index = 0;
167 for(int Key = KEY_A; Key < KEY_JOY_AXIS_11_RIGHT; Key++)
168 {
169 // Ignore unnamed keys starting with '&'
170 const char *pKeyName = pInput->KeyName(Key);
171 if(pKeyName[0] != '&' && str_find_nocase(pKeyName, pStr))
172 {
173 pfnCallback(Index, pKeyName, pUser);
174 Index++;
175 }
176 }
177 return Index;
178}
179
180static void CollectPossibleCommandsCallback(int Index, const char *pStr, void *pUser)
181{

Callers 1

Calls 2

str_find_nocaseFunction · 0.85
KeyNameMethod · 0.80

Tested by

no test coverage detected