base class — SCA_ISensor
This sensor detects player joystick events.
The state of the joysticks axis as a list of values numAxis long. (read-only).
Type: | list of ints. |
---|
Each specifying 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.
like axisValues but returns a single axis value that is set by the sensor. (read-only).
Type: | integer |
---|
Note
Only use this for “Single Axis” type sensors otherwise it will raise an error.
The state of the joysticks hats as a list of values numHats long. (read-only).
Type: | list of ints |
---|
Each specifying the direction of the hat from 1 to 12, 0 when inactive.
Hat directions are as follows...
Like hatValues but returns a single hat direction value that is set by the sensor. (read-only).
Type: | integer |
---|
The number of axes for the joystick at this index. (read-only).
Type: | integer |
---|
The number of buttons for the joystick at this index. (read-only).
Type: | integer |
---|
The number of hats for the joystick at this index. (read-only).
Type: | integer |
---|
True if a joystick is connected at this joysticks index. (read-only).
Type: | boolean |
---|
The joystick index to use (from 0 to 7). The first joystick is always 0.
Type: | integer |
---|
Axis threshold. Joystick axis motion below this threshold wont trigger an event. Use values between (0 and 32767), lower values are more sensitive.
Type: | integer |
---|
The button index the sensor reacts to (first button = 0). When the “All Events” toggle is set, this option has no effect.
Type: | integer |
---|
The axis this sensor reacts to, as a list of two values [axisIndex, axisDirection]
Type: | [integer, integer] |
---|
The hat the sensor reacts to, as a list of two values: [hatIndex, hatDirection]
Type: | [integer, integer] |
---|
Returns: | A list containing the indicies of the currently pressed buttons. |
---|---|
Return type: | list |
Parameters: | buttonIndex (integer) – the button index, 0=first button |
---|---|
Returns: | The current pressed state of the specified button. |
Return type: | boolean |