diff options
Diffstat (limited to 'source/gameengine/PyDoc/SCA_JoystickSensor.py')
-rw-r--r-- | source/gameengine/PyDoc/SCA_JoystickSensor.py | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/source/gameengine/PyDoc/SCA_JoystickSensor.py b/source/gameengine/PyDoc/SCA_JoystickSensor.py index d1dab9afcaf..111ee7f4cfa 100644 --- a/source/gameengine/PyDoc/SCA_JoystickSensor.py +++ b/source/gameengine/PyDoc/SCA_JoystickSensor.py @@ -5,15 +5,58 @@ from SCA_ISensor import * class SCA_JoystickSensor(SCA_ISensor): """ This sensor detects player joystick events. + + 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 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. + @type numButtons: integer + @ivar numHats: (read-only) The number of hats for the joystick at this index. + @type numHats: integer + @ivar connected: (read-only) True if a joystick is connected at this joysticks index. + @type connected: boolean + @ivar index: The joystick index to use (from 0 to 7). The first joystick is always 0. + @type index: integer + @ivar threshold: Axis threshold. Joystick axis motion below this threshold wont trigger an event. Use values between (0 and 32767), lower values are more sensitive. + @type threshold: integer + @ivar button: The button index the sensor reacts to (first button = 0). When the "All Events" toggle is set, this option has no effect. + @type button: integer + @ivar axis: The axis this sensor reacts to, as a list of two values [axisIndex, axisDirection] + axisIndex: the axis index to use when detecting axis movement, 1=primary directional control, 2=secondary directional control. + 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 + @type hat: [integer, integer] """ + def getButtonActiveList(): + """ + Returns a list containing the indicies of the currently pressed buttons. + @rtype: list + """ + def getButtonStatus(buttonIndex): + """ + Returns a bool of the current pressed state of the specified button. + @param buttonIndex: the button index, 0=first button + @type buttonIndex: integer + @rtype: bool + """ def getIndex(): """ + DEPRECATED: use the 'index' property. Returns the joystick index to use (from 1 to 8). @rtype: integer """ def setIndex(index): """ + DEPRECATED: use the 'index' property. Sets the joystick index to use. @param index: The index of this joystick sensor, Clamped between 1 and 8. @type index: integer @@ -21,6 +64,7 @@ class SCA_JoystickSensor(SCA_ISensor): """ def getAxis(): """ + DEPRECATED: use the 'axis' property. Returns the current axis this sensor reacts to. See L{getAxisValue()<SCA_JoystickSensor.getAxisValue>} for the current axis state. @rtype: list @return: 2 values returned are [axisIndex, axisDirection] - see L{setAxis()<SCA_JoystickSensor.setAxis>} for their purpose. @@ -28,6 +72,7 @@ class SCA_JoystickSensor(SCA_ISensor): """ def setAxis(axisIndex, axisDirection): """ + DEPRECATED: use the 'axis' property. @param axisIndex: Set the axis index to use when detecting axis movement. @type axisIndex: integer from 1 to 2 @param axisDirection: Set the axis direction used for detecting motion. 0:right, 1:up, 2:left, 3:down. @@ -36,6 +81,7 @@ class SCA_JoystickSensor(SCA_ISensor): """ def getAxisValue(): """ + DEPRECATED: use the 'axisPosition' property. Returns the state of the joysticks axis. See differs to L{getAxis()<SCA_JoystickSensor.getAxis>} returning the current state of the joystick. @rtype: list @return: 4 values, each spesifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing. @@ -47,60 +93,71 @@ class SCA_JoystickSensor(SCA_ISensor): """ def getThreshold(): """ + DEPRECATED: use the 'threshold' property. Get the axis threshold. See L{setThreshold()<SCA_JoystickSensor.setThreshold>} for details. @rtype: integer """ def setThreshold(threshold): """ + DEPRECATED: use the 'threshold' property. Set the axis threshold. @param threshold: Joystick axis motion below this threshold wont trigger an event. Use values between (0 and 32767), lower values are more sensitive. @type threshold: integer """ def getButton(): """ + DEPRECATED: use the 'button' property. Returns the button index the sensor reacts to. See L{getButtonValue()<SCA_JoystickSensor.getButtonValue>} for a list of pressed buttons. @rtype: integer @note: When the "All Events" toggle is set, this option has no effect. """ def setButton(index): """ + DEPRECATED: use the 'button' property. Sets the button index the sensor reacts to when the "All Events" option is not set. @note: When the "All Events" toggle is set, this option has no effect. """ def getButtonValue(): """ + DEPRECATED: use the 'getButtonActiveList' method. Returns a list containing the indicies of the currently pressed buttons. @rtype: list """ def getHat(): """ + DEPRECATED: use the 'hat' property. Returns the current hat direction this sensor is set to. [hatNumber, hatDirection]. @rtype: list @note: When the "All Events" toggle is set, this option has no effect. """ - def setHat(index): + def setHat(index,direction): """ + DEPRECATED: use the 'hat' property. Sets the hat index the sensor reacts to when the "All Events" option is not set. @type index: integer """ def getNumAxes(): """ + DEPRECATED: use the 'numAxis' property. Returns the number of axes for the joystick at this index. @rtype: integer """ def getNumButtons(): """ + DEPRECATED: use the 'numButtons' property. Returns the number of buttons for the joystick at this index. @rtype: integer """ def getNumHats(): """ + DEPRECATED: use the 'numHats' property. Returns the number of hats for the joystick at this index. @rtype: integer """ def isConnected(): """ + DEPRECATED: use the 'connected' property. Returns True if a joystick is detected at this joysticks index. @rtype: bool """ |