Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2008-10-07 09:09:24 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-10-07 09:09:24 +0400
commit77484d28d5098de2fd3924df28d846023d7751ec (patch)
tree3ea8a3660c8e9bb18f0421f6d95c0a604fd710c1 /source/blender/makesdna/DNA_sensor_types.h
parent8d73ea72a75ce5567fc2a39f2acc2ad5b2543f4c (diff)
joystick update
* use SDL events to trigger the sensor, trigger was being forced every tick. removed workaround for this problem. * added "All Events" option, similar to all keys in the keyboard sensor. This means every event from the joystick will trigger the sensor, however only events from the selected type (axis/button/hat) is used to set the positive state of the sensor. * Added python function sens_joy.GetButtonValues(), returns a list of pressed button indicies. * Removed pressed/released option for joystick buttons, it was the same as the invert option.
Diffstat (limited to 'source/blender/makesdna/DNA_sensor_types.h')
-rw-r--r--source/blender/makesdna/DNA_sensor_types.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h
index 1fd97fe0158..d8a1ffc6c24 100644
--- a/source/blender/makesdna/DNA_sensor_types.h
+++ b/source/blender/makesdna/DNA_sensor_types.h
@@ -163,12 +163,12 @@ typedef struct bSensor {
typedef struct bJoystickSensor {
char name[32];
- short type;
- short joyindex;
+ char type;
+ char joyindex;
+ short flag;
int axis;
int axisf;
int button;
- int buttonf;
int hat;
int hatf;
int precision;
@@ -252,6 +252,8 @@ typedef struct bJoystickSensor {
#define BL_SENS_MOUSE_MOUSEOVER 16
#define BL_SENS_MOUSE_MOUSEOVER_ANY 32
+#define SENS_JOY_ANY_EVENT 1
+
#define SENS_JOY_BUTTON 0
#define SENS_JOY_BUTTON_PRESSED 0
#define SENS_JOY_BUTTON_RELEASED 1
@@ -266,6 +268,7 @@ typedef struct bJoystickSensor {
#define SENS_JOY_HAT 2
#define SENS_JOY_HAT_DIR 0
+
#define SENS_DELAY_REPEAT 1
// should match JOYINDEX_MAX in SCA_JoystickDefines.h */
#define SENS_JOY_MAXINDEX 8