From: havoc Date: Tue, 10 Feb 2004 21:09:57 +0000 (+0000) Subject: change joystick key numbers to start at 768 instead of 1024 (this gives 512 keys... X-Git-Tag: xonotic-v0.1.0preview~6100 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=bbf17fb0ee20bbc2d7e18afa52c7afd743504867 change joystick key numbers to start at 768 instead of 1024 (this gives 512 keys, 256 mouse, 256 joystick) enlarge various key arrays to hold 1024 keys git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3888 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/keys.c b/keys.c index 4d5f4fb3..00b8826f 100644 --- a/keys.c +++ b/keys.c @@ -50,13 +50,13 @@ int key_consoleactive; static int key_count; // incremented every key event static int key_bmap, key_bmap2; -char *keybindings[8][256]; -static qboolean consolekeys[256]; // if true, can't be rebound while in +char *keybindings[8][1024]; +static qboolean consolekeys[1024]; // if true, can't be rebound while in // console -static qboolean menubound[256]; // if true, can't be rebound while in +static qboolean menubound[1024]; // if true, can't be rebound while in // menu -static unsigned int key_repeats[256]; // if > 1, it is autorepeating -static qboolean keydown[256]; +static unsigned int key_repeats[1024]; // if > 1, it is autorepeating +static qboolean keydown[1024]; typedef struct { const char *name; @@ -734,7 +734,7 @@ Key_Unbindall_f (void) int i, j; for (j = 0; j < 8; j++) - for (i = 0; i < 256; i++) + for (i = 0; i < sizeof(keybindings[0])/sizeof(keybindings[0][0]); i++) if (keybindings[j][i]) Key_SetBinding (i, j, ""); } @@ -786,12 +786,12 @@ Key_WriteBindings (qfile_t *f) { int i, j; - for (i = 0; i < 256; i++) + for (i = 0; i < sizeof(keybindings[0])/sizeof(keybindings[0][0]); i++) if (keybindings[0][i]) FS_Printf (f, "bind %s \"%s\"\n", Key_KeynumToString (i), keybindings[0][i]); for (j = 1; j < 8; j++) - for (i = 0; i < 256; i++) + for (i = 0; i < sizeof(keybindings[0])/sizeof(keybindings[0][0]); i++) if (keybindings[j][i]) FS_Printf (f, "in_bind %d %s \"%s\"\n", j, Key_KeynumToString (i), keybindings[j][i]); @@ -1016,7 +1016,7 @@ Key_ClearStates (void) { int i; - for (i = 0;i < 256;i++) + for (i = 0; i < sizeof(keydown)/sizeof(keydown[0]); i++) { keydown[i] = false; key_repeats[i] = 0; diff --git a/keys.h b/keys.h index 0cf98f47..a9a852e1 100644 --- a/keys.h +++ b/keys.h @@ -127,7 +127,7 @@ extern enum { // // joystick buttons // - K_JOY1 = 1024, + K_JOY1 = 768, K_JOY2, K_JOY3, K_JOY4, @@ -173,7 +173,7 @@ extern enum { typedef enum { key_game, key_message, key_menu } keydest_t; -extern char *keybindings[8][256]; +extern char *keybindings[8][1024]; extern char key_lines[32][256]; extern int key_linepos; extern int edit_line;