aboutsummaryrefslogtreecommitdiffstats
path: root/code/client
diff options
context:
space:
mode:
Diffstat (limited to 'code/client')
-rw-r--r--code/client/cl_keys.c25
-rw-r--r--code/client/cl_main.c4
2 files changed, 6 insertions, 23 deletions
diff --git a/code/client/cl_keys.c b/code/client/cl_keys.c
index fea1b74..3097f54 100644
--- a/code/client/cl_keys.c
+++ b/code/client/cl_keys.c
@@ -776,7 +776,6 @@ qboolean Key_IsDown( int keynum ) {
return keys[keynum].down;
}
-
/*
===================
Key_StringToKeynum
@@ -801,28 +800,12 @@ int Key_StringToKeynum( char *str ) {
}
// check for hex code
- if ( str[0] == '0' && str[1] == 'x' && strlen( str ) == 4) {
- int n1, n2;
-
- n1 = str[2];
- if ( n1 >= '0' && n1 <= '9' ) {
- n1 -= '0';
- } else if ( n1 >= 'a' && n1 <= 'f' ) {
- n1 = n1 - 'a' + 10;
- } else {
- n1 = 0;
- }
+ if ( strlen( str ) == 4 ) {
+ int n = Com_HexStrToInt( str );
- n2 = str[3];
- if ( n2 >= '0' && n2 <= '9' ) {
- n2 -= '0';
- } else if ( n2 >= 'a' && n2 <= 'f' ) {
- n2 = n2 - 'a' + 10;
- } else {
- n2 = 0;
+ if ( n >= 0 ) {
+ return n;
}
-
- return n1 * 16 + n2;
}
// scan for a text match
diff --git a/code/client/cl_main.c b/code/client/cl_main.c
index 23a07d6..353d2b3 100644
--- a/code/client/cl_main.c
+++ b/code/client/cl_main.c
@@ -3079,8 +3079,8 @@ void CL_Init( void ) {
cl_guidServerUniq = Cvar_Get ("cl_guidServerUniq", "1", CVAR_ARCHIVE);
- // 0x7e = ~ and 0x60 = `
- cl_consoleKeys = Cvar_Get( "cl_consoleKeys", "0x7e 0x60", CVAR_ARCHIVE);
+ // ~ and `, as keys and characters
+ cl_consoleKeys = Cvar_Get( "cl_consoleKeys", "~ ` 0x7e 0x60", CVAR_ARCHIVE);
// userinfo
Cvar_Get ("name", "UnnamedPlayer", CVAR_USERINFO | CVAR_ARCHIVE );