| 164 | //============================================================================= |
| 165 | |
| 166 | static 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 | // |
no test coverage detected