Fixed a couple bugs involving OpenArena::Keys where either windows virtual keys or char's were being used instead.

~g2k
This commit is contained in:
2005-07-14 16:08:50 -04:00
parent 40c2acbbf9
commit 5a6c0fca9d
7 changed files with 288 additions and 203 deletions

View File

@@ -366,8 +366,12 @@ uint8 KeyName(std::string str)
return OpenArena::KEY_OEM_5;
else if (str[0] == '\'' || str[0] == '"')
return OpenArena::KEY_OEM_7;
else if (isalpha(str[0]))
return toupper(str[0]) - 'A' + OpenArena::KEY_A;
else if(isdigit(str[0]))
return str[0] - '0' + OpenArena::KEY_0;
else
return toupper(str[0]);
return OpenArena::KEY_UNKNOWN;
}
}