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.
This commit is contained in:
@@ -8,10 +8,16 @@ class SCA_JoystickSensor(SCA_ISensor):
|
||||
|
||||
Properties:
|
||||
|
||||
@ivar axisPosition: (read-only) The state of the joysticks axis as a list of 4 values, each spesifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing.
|
||||
The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls.
|
||||
left:[-32767, 0, ...], right:[32767, 0, ...], up:[0, -32767, ...], down:[0, 32767, ...]
|
||||
@type axisPosition: [integer, integer, integer, integer]
|
||||
@ivar axisValues: (read-only) The state of the joysticks axis as a list of values L{numAxis} long.
|
||||
each spesifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing.
|
||||
The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls.
|
||||
left:[-32767, 0, ...], right:[32767, 0, ...], up:[0, -32767, ...], down:[0, 32767, ...]
|
||||
@type axisValues: list of ints
|
||||
|
||||
@ivar axisSingle: (read-only) like L{axisValues} but returns a single axis value that is set by the sensor.
|
||||
Only use this for "Single Axis" type sensors otherwise it will raise an error.
|
||||
@type axisSingle: 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.
|
||||
|
||||
Reference in New Issue
Block a user