diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-05-25 10:24:23 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-05-25 10:24:23 +0400 |
commit | 2fa8504dd104e0bde32ee487f97fbce4fd6d7104 (patch) | |
tree | de257b1dc9329c0819a201f0140c8b0be9487969 /source/gameengine/PyDoc | |
parent | 2a9d9605d08e2521b2c6aadafe8294e1eed78fc3 (diff) |
BGE Joystick Hat Bugfix
bug reported by blenderage on blenderartist (found other bugs too).
- "All Hat Events" didnt work.
- Multiple hats didnt work
- use a menu with direction names rather then have the user guess. disallow zero as a direction.
- Allow up to 4 hats (was 2).
- Python api was clamping the axis to 2, maximum is currently JOYAXIS_MAX - 16
- New python attributes hatValues and hatSingle, match axis functions.
- Use SDL Axis events to fill in the axis and hat array rather then filling in every axis with SDL_JoystickGetAxis for each axis event.
Diffstat (limited to 'source/gameengine/PyDoc')
-rw-r--r-- | source/gameengine/PyDoc/GameTypes.py | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index 8a590a48c9e..ca9c674a942 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -47,6 +47,7 @@ class CValue(PyObjectPlus): This class is a basis for other classes. @ivar name: The name of this CValue derived object (read-only). @type name: string + @group Deprecated: getName """ def getName(): """ @@ -259,7 +260,7 @@ class SCA_IController(SCA_ILogicBrick): @type actuators: sequence supporting index/string lookups and iteration. @ivar bookmark: the bookmark option. If set, the controller executes always before all other non-bookmarked controllers. - - note: Order of execution between bookmarked controllers is not guaranteed. + note: Order of execution between bookmarked controllers is not guaranteed. @type bookmark: bool """ #{ Deprecated @@ -4741,6 +4742,24 @@ class SCA_JoystickSensor(SCA_ISensor): Only use this for "Single Axis" type sensors otherwise it will raise an error. @type axisSingle: int + @ivar hatValues: (read-only) The state of the joysticks hats as a list of values L{numHats} long. + each spesifying the direction of the hat from 1 to 12, 0 when inactive. + Hat directions are as follows... + - 0:None + - 1:Up + - 2:Right + - 4:Down + - 8:Left + - 3:Up - Right + - 6:Down - Right + - 12:Down - Left + - 9:Up - Left + + @type hatValues: list of ints + + @ivar hatSingle: (read-only) like L{hatValues} but returns a single hat direction value that is set by the sensor. + @type hatSingle: int + @ivar numAxis: (read-only) The number of axes for the joystick at this index. @type numAxis: integer @ivar numButtons: (read-only) The number of buttons for the joystick at this index. @@ -4760,8 +4779,8 @@ class SCA_JoystickSensor(SCA_ISensor): axisDirection: 0=right, 1=up, 2=left, 3=down @type axis: [integer, integer] @ivar hat: The hat the sensor reacts to, as a list of two values: [hatIndex, hatDirection] - hatIndex: the hat index to use when detecting hat movement, 1=primary hat, 2=secondary hat. - hatDirection: 0-11 + hatIndex: the hat index to use when detecting hat movement, 1=primary hat, 2=secondary hat (4 max). + hatDirection: 1-12 @type hat: [integer, integer] """ |