From 885fa49aa4cd49a552bfe6210e3cb4701c4a5d04 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 7 Apr 2009 06:23:45 +0000 Subject: BGE Joystick Sensor - Raised limit of 2 axis to 4 axis pairs (4==8 joysticks axis pairs) - Added a new Joystick Sensor type "Single Axis", so you can detect horizontal or vertical movement, rather then just Up/Down/Left/Right - added Python attribute "axisSingle" so you can get the value from the selected axis (rather then getting it out of the axis list) - renamed Py attribute "axisPosition" to "axisValues" (was never in a release) If we need to increase the axis limit again just change JOYAXIS_MAX and the button limits. --- source/blender/makesdna/DNA_sensor_types.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source/blender/makesdna/DNA_sensor_types.h') diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h index 2cae2cc8ccb..7a358ad0694 100644 --- a/source/blender/makesdna/DNA_sensor_types.h +++ b/source/blender/makesdna/DNA_sensor_types.h @@ -166,7 +166,8 @@ typedef struct bJoystickSensor { char type; char joyindex; short flag; - int axis; + short axis; + short axis_single; int axisf; int button; int hat; @@ -255,20 +256,22 @@ typedef struct bJoystickSensor { #define SENS_JOY_ANY_EVENT 1 -#define SENS_JOY_BUTTON 0 +#define SENS_JOY_BUTTON 0 /* axis type */ #define SENS_JOY_BUTTON_PRESSED 0 #define SENS_JOY_BUTTON_RELEASED 1 -#define SENS_JOY_AXIS 1 +#define SENS_JOY_AXIS 1 /* axis type */ #define SENS_JOY_X_AXIS 0 #define SENS_JOY_Y_AXIS 1 #define SENS_JOY_NEG_X_AXIS 2 #define SENS_JOY_NEG_Y_AXIS 3 #define SENS_JOY_PRECISION 4 -#define SENS_JOY_HAT 2 +#define SENS_JOY_HAT 2 /* axis type */ #define SENS_JOY_HAT_DIR 0 +#define SENS_JOY_AXIS_SINGLE 3 /* axis type */ + #define SENS_DELAY_REPEAT 1 // should match JOYINDEX_MAX in SCA_JoystickDefines.h */ -- cgit v1.2.3