MCPcopy Create free account
hub / github.com/ZDoom/Raze / GetKeyFromName

Function GetKeyFromName

source/common/console/c_bind.cpp:166–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164//=============================================================================
165
166static int GetKeyFromName (const char *name)
167{
168 int i;
169
170 // Names of the form #xxx are translated to key xxx automatically
171 if (name[0] == '#' && name[1] != 0)
172 {
173 return atoi (name + 1);
174 }
175
176 // Otherwise, we scan the KeyNames[] array for a matching name
177 for (i = 0; i < NUM_KEYS; i++)
178 {
179 if (KeyNames[i] && !stricmp (KeyNames[i], name))
180 return i;
181 }
182 return 0;
183}
184
185//=============================================================================
186//

Callers 4

GetConfigKeyFromNameFunction · 0.85
UnbindKeyMethod · 0.85
PerformBindMethod · 0.85
DefaultBindMethod · 0.85

Calls 1

stricmpFunction · 0.85

Tested by

no test coverage detected