Added support for 16 joystick buttons.
authortomaz <tomaz@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 12 Sep 2004 18:11:24 +0000 (18:11 +0000)
committertomaz <tomaz@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 12 Sep 2004 18:11:24 +0000 (18:11 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4490 d7cf8633-e32d-0410-b094-e92efae38249

keys.c
keys.h
vid_wgl.c

diff --git a/keys.c b/keys.c
index d4935d0..f1fa5c5 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -154,10 +154,22 @@ static const keyname_t   keynames[] = {
        {"KP_ENTER", K_KP_ENTER},
        {"KP_EQUALS", K_KP_EQUALS},
 
-       {"JOY1", K_JOY1},
-       {"JOY2", K_JOY2},
-       {"JOY3", K_JOY3},
-       {"JOY4", K_JOY4},
+       {"JOY1",  K_JOY1},
+       {"JOY2",  K_JOY2},
+       {"JOY3",  K_JOY3},
+       {"JOY4",  K_JOY4},
+       {"JOY5",  K_JOY5},
+       {"JOY6",  K_JOY6},
+       {"JOY7",  K_JOY7},
+       {"JOY8",  K_JOY8},
+       {"JOY9",  K_JOY9},
+       {"JOY10", K_JOY10},
+       {"JOY11", K_JOY11},
+       {"JOY12", K_JOY12},
+       {"JOY13", K_JOY13},
+       {"JOY14", K_JOY14},
+       {"JOY15", K_JOY15},
+       {"JOY16", K_JOY16},
 
        {"AUX1", K_AUX1},
        {"AUX2", K_AUX2},
diff --git a/keys.h b/keys.h
index a9a852e..b8eb9df 100644 (file)
--- a/keys.h
+++ b/keys.h
@@ -131,6 +131,18 @@ extern enum {
        K_JOY2,
        K_JOY3,
        K_JOY4,
+       K_JOY5,
+       K_JOY6,
+       K_JOY7,
+       K_JOY8,
+       K_JOY9,
+       K_JOY10,
+       K_JOY11,
+       K_JOY12,
+       K_JOY13,
+       K_JOY14,
+       K_JOY15,
+       K_JOY16,
 
 //
 // aux keys are for multi-buttoned joysticks to generate so they can use
index afa865c..99235ff 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -1702,13 +1702,13 @@ void IN_Commands (void)
        {
                if ( (buttonstate & (1<<i)) && !(joy_oldbuttonstate & (1<<i)) )
                {
-                       key_index = (i < 4) ? K_JOY1 : K_AUX1;
+                       key_index = (i < 16) ? K_JOY1 : K_AUX1;
                        Key_Event (key_index + i, 0, true);
                }
 
                if ( !(buttonstate & (1<<i)) && (joy_oldbuttonstate & (1<<i)) )
                {
-                       key_index = (i < 4) ? K_JOY1 : K_AUX1;
+                       key_index = (i < 16) ? K_JOY1 : K_AUX1;
                        Key_Event (key_index + i, 0, false);
                }
        }