summaryrefslogtreecommitdiff
path: root/src/d_event.h
diff options
context:
space:
mode:
authorSimon Howard2014-04-19 01:12:13 -0400
committerSimon Howard2014-04-19 01:12:13 -0400
commit74e1b8b7548e6d14eb9be748279e8100a766cf04 (patch)
treeed10a7eb0605d8fd58e4bd8974a2994eb839976b /src/d_event.h
parent64cdaabd292d54fe3637b4530eb610af2d46c647 (diff)
downloadchocolate-doom-74e1b8b7548e6d14eb9be748279e8100a766cf04.tar.gz
chocolate-doom-74e1b8b7548e6d14eb9be748279e8100a766cf04.tar.bz2
chocolate-doom-74e1b8b7548e6d14eb9be748279e8100a766cf04.zip
joystick: Add an axis to allow strafing.
Modern gamepads typically have 2-3 D-pads and joysticks. This means that it's desirable to be able to use one joystick for turning and another for strafing. Add another axis in addition to the current X and y axes that performs strafe movement.
Diffstat (limited to 'src/d_event.h')
-rw-r--r--src/d_event.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/d_event.h b/src/d_event.h
index 25334a96..230f3fa5 100644
--- a/src/d_event.h
+++ b/src/d_event.h
@@ -49,10 +49,30 @@ typedef enum
// Event structure.
typedef struct
{
- evtype_t type;
- int data1; // keys / mouse/joystick buttons
- int data2; // mouse/joystick x move
- int data3; // mouse/joystick y move
+ evtype_t type;
+
+ // Event-related data that depends on the type of event:
+ //
+ // ev_keydown/ev_keyup:
+ // data1: Key code (from doomkeys.h) of the key that was
+ // pressed or released.
+ // data2: Ascii text of the character that was pressed,
+ // shifted appropriately (eg. '$' if 4 was pressed
+ // while shift was held).
+ //
+ // ev_mouse:
+ // data1: Bitfield of buttons currently held down.
+ // (bit 0 = left; bit 1 = right; bit 2 = middle).
+ // data2: X axis mouse movement (turn).
+ // data3: Y axis mouse movement (forward/backward).
+ //
+ // ev_joystick:
+ // data1: Bitfield of buttons currently pressed.
+ // data2: X axis mouse movement (turn).
+ // data3: Y axis mouse movement (forward/backward).
+ // data4: Third axis mouse movement (strafe).
+
+ int data1, data2, data3, data4;
} event_t;