diff --git a/changelog.txt b/changelog.txt index 6c9c13c..48399a4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -140,6 +140,8 @@ chg: r_fullbright is now latched again chg: negative r_swapInterval values will request adaptive V-Sync when using an OpenGL back-end +fix: made more keys bindable on Linux/FreeBSD and /bind now accepts uppercase hex digits + fix: removing CVars through unset/cvar_trim/cvar_restart could leave data in an invalid state fix: r_detailTextures 0 would mess up shaders where "detail" was used in a stage that isn't the last one diff --git a/code/client/cl_keys.cpp b/code/client/cl_keys.cpp index 9900176..4c2c223 100644 --- a/code/client/cl_keys.cpp +++ b/code/client/cl_keys.cpp @@ -682,7 +682,7 @@ static int Key_StringToKeynum( const char* str ) if ( str[0] == '0' && str[1] == 'x' && strlen( str ) == 4) { int n1, n2; - n1 = str[2]; + n1 = tolower( str[2] ); if ( n1 >= '0' && n1 <= '9' ) { n1 -= '0'; } else if ( n1 >= 'a' && n1 <= 'f' ) { @@ -691,7 +691,7 @@ static int Key_StringToKeynum( const char* str ) n1 = 0; } - n2 = str[3]; + n2 = tolower( str[3] ); if ( n2 >= '0' && n2 <= '9' ) { n2 -= '0'; } else if ( n2 >= 'a' && n2 <= 'f' ) { @@ -748,8 +748,8 @@ const char* Key_KeynumToString( int keynum ) tinystr[0] = '0'; tinystr[1] = 'x'; - tinystr[2] = i > 9 ? i - 10 + 'a' : i + '0'; - tinystr[3] = j > 9 ? j - 10 + 'a' : j + '0'; + tinystr[2] = i > 9 ? i - 10 + 'A' : i + '0'; + tinystr[3] = j > 9 ? j - 10 + 'A' : j + '0'; tinystr[4] = 0; return tinystr; diff --git a/code/linux/sdl_core.cpp b/code/linux/sdl_core.cpp index 1ad0ff1..d6acafc 100644 --- a/code/linux/sdl_core.cpp +++ b/code/linux/sdl_core.cpp @@ -163,6 +163,10 @@ static int QuakeKeyFromSDLKey( SDL_Keysym key ) case SDLK_KP_PLUS: return K_KP_PLUS; case SDLK_KP_MULTIPLY: return K_KP_STAR; case SDLK_BACKSLASH: return K_BACKSLASH; + case SDLK_PAUSE: return K_PAUSE; + case SDLK_NUMLOCKCLEAR: return K_KP_NUMLOCK; + case SDLK_KP_EQUALS: return K_KP_EQUALS; + case SDLK_MENU: return K_MENU; case SDLK_PERIOD: return '.'; case SDLK_COMMA: return ','; case SDLK_EXCLAIM: return '!'; @@ -186,11 +190,19 @@ static int QuakeKeyFromSDLKey( SDL_Keysym key ) case SDLK_LEFTBRACKET: return '['; case SDLK_RIGHTBRACKET: return ']'; case SDLK_UNDERSCORE: return '_'; - // missing: - // K_KP_NUMLOCK - // K_KP_EQUALS - default: return -1; + case SDLK_SEMICOLON: return ';'; + // not handled: + // K_COMMAND (Apple) + // K_POWER (Apple) + // K_AUX1-16 + // K_WIN + default: break; } + + if (sym >= 32 && sym <= 126) + return (int)sym; + + return -1; }