diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-10-07 09:09:24 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-10-07 09:09:24 +0400 |
commit | 77484d28d5098de2fd3924df28d846023d7751ec (patch) | |
tree | 3ea8a3660c8e9bb18f0421f6d95c0a604fd710c1 /source/gameengine/GameLogic/Joystick/SCA_Joystick.h | |
parent | 8d73ea72a75ce5567fc2a39f2acc2ad5b2543f4c (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/gameengine/GameLogic/Joystick/SCA_Joystick.h')
-rw-r--r-- | source/gameengine/GameLogic/Joystick/SCA_Joystick.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h index ea7ecf7cefe..33cfbd74d05 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h +++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h @@ -29,7 +29,9 @@ #define _SCA_JOYSTICK_H_ #include "SCA_JoystickDefines.h" +#ifndef DISABLE_SDL #include "SDL.h" +#endif /* * Basic Joystick class @@ -83,8 +85,11 @@ class SCA_Joystick /* * max # of buttons avail */ - + + int m_axismax; int m_buttonmax; + int m_hatmax; + /* * hat values stored here */ @@ -134,18 +139,12 @@ class SCA_Joystick /* * returns m_axis10,m_axis11... */ - int pGetAxis(int axisnum, int udlr); - - /* - * gets the current button - */ - - int pGetButtonPress(int button); + int pAxisTest(int axisnum); /* - * returns if no button is pressed + * returns m_axis10,m_axis11... */ - int pGetButtonRelease(int button); + int pGetAxis(int axisnum, int udlr); /* * gets the current hat direction @@ -165,11 +164,14 @@ public: /* */ - + bool aAnyAxisIsPositive(int axis); bool aUpAxisIsPositive(int axis); bool aDownAxisIsPositive(int axis); bool aLeftAxisIsPositive(int axis); bool aRightAxisIsPositive(int axis); + + bool aAnyButtonPressIsPositive(void); + bool aAnyButtonReleaseIsPositive(void); bool aButtonPressIsPositive(int button); bool aButtonReleaseIsPositive(int button); bool aHatIsPositive(int dir); |