Joystick allows an application to control one or more joysticks.
See also
__init__ | Constructor. |
GetButtonState | Returns the state of the joystick buttons. |
GetManufacturerId | Returns the manufacturer id. |
GetMovementThreshold | Returns the movement threshold, the number of steps outside which the joystick is deemed to have moved. |
GetNumberAxes | Returns the number of axes for this joystick. |
GetNumberButtons | Returns the number of buttons for this joystick. |
GetNumberJoysticks | Returns the number of joysticks currently attached to the computer. |
GetPOVCTSPosition | Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units. |
GetPOVPosition | Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units, but limited to return 0, 9000, 18000 or 27000. |
GetPollingMax | Returns the maximum polling frequency. |
GetPollingMin | Returns the minimum polling frequency. |
GetPosition | Returns the x, y position of the joystick. |
GetProductId | Returns the product id for the joystick. |
GetProductName | Returns the product name for the joystick. |
GetRudderMax | Returns the maximum rudder position. |
GetRudderMin | Returns the minimum rudder position. |
GetRudderPosition | Returns the rudder position. |
GetUMax | Returns the maximum U position. |
GetUMin | Returns the minimum U position. |
GetUPosition | Gets the position of the fifth axis of the joystick, if it exists. |
GetVMax | Returns the maximum V position. |
GetVMin | Returns the minimum V position. |
GetVPosition | Gets the position of the sixth axis of the joystick, if it exists. |
GetXMax | Returns the maximum x position. |
GetXMin | Returns the minimum x position. |
GetYMax | Returns the maximum y position. |
GetYMin | Returns the minimum y position. |
GetZMax | Returns the maximum z position. |
GetZMin | Returns the minimum z position. |
GetZPosition | Returns the z position of the joystick. |
HasPOV | Returns True if the joystick has a point of view control. |
HasPOV4Dir | Returns True if the joystick point-of-view supports discrete values (centered, forward, backward, left, and right). |
HasPOVCTS | Returns True if the joystick point-of-view supports continuous degree bearings. |
HasRudder | Returns True if there is a rudder attached to the computer. |
HasU | Returns True if the joystick has a U axis. |
HasV | Returns True if the joystick has a V axis. |
HasZ | Returns True if the joystick has a Z axis. |
IsOk | Returns True if the joystick is functioning. |
ReleaseCapture | Releases the capture set by SetCapture. |
SetCapture | Sets the capture to direct joystick events to win. |
SetMovementThreshold | Sets the movement threshold, the number of steps outside which the joystick is deemed to have moved. |
ButtonState | See GetButtonState |
ManufacturerId | See GetManufacturerId |
MovementThreshold | See GetMovementThreshold and SetMovementThreshold |
NumberAxes | See GetNumberAxes |
NumberButtons | See GetNumberButtons |
POVCTSPosition | See GetPOVCTSPosition |
POVPosition | See GetPOVPosition |
PollingMax | See GetPollingMax |
PollingMin | See GetPollingMin |
Position | See GetPosition |
ProductId | See GetProductId |
ProductName | See GetProductName |
RudderMax | See GetRudderMax |
RudderMin | See GetRudderMin |
RudderPosition | See GetRudderPosition |
UMax | See GetUMax |
UMin | See GetUMin |
UPosition | See GetUPosition |
VMax | See GetVMax |
VMin | See GetVMin |
VPosition | See GetVPosition |
XMax | See GetXMax |
XMin | See GetXMin |
YMax | See GetYMax |
YMin | See GetYMin |
ZMax | See GetZMax |
ZMin | See GetZMin |
ZPosition | See GetZPosition |
Joystick allows an application to control one or more joysticks.
Possible constructors:
Joystick(joystick=JOYSTICK1)
Constructor.
joystick may be one of JOYSTICK1, JOYSTICK2, indicating the joystick controller of interest.
Parameters: | joystick (int) – |
---|
Overloaded Implementations:
GetButtonState (self)
Returns the state of the joystick buttons.
Every button is mapped to a single bit in the returned integer, with the first button being mapped to the least significant bit, and so on.
A bitlist of JOY_BUTTONn identifiers, where n is 1, 2, 3 or 4 is available for historical reasons.
Return type: | int |
---|
GetButtonState (self, id)
Returns the state of the specified joystick button.
Parameters: | id (int) – The button id to report, from 0 to GetNumberButtons - 1 |
---|---|
Return type: | bool |
Returns the manufacturer id.
Return type: | int |
---|
Returns the movement threshold, the number of steps outside which the joystick is deemed to have moved.
Return type: | int |
---|
Returns the number of axes for this joystick.
Return type: | int |
---|
Returns the number of buttons for this joystick.
Return type: | int |
---|
Returns the number of joysticks currently attached to the computer.
Return type: | int |
---|
Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units.
Returns -1 on error.
Return type: | int |
---|
Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units, but limited to return 0, 9000, 18000 or 27000.
Returns -1 on error.
Return type: | int |
---|
Returns the maximum polling frequency.
Return type: | int |
---|
Returns the minimum polling frequency.
Return type: | int |
---|
Overloaded Implementations:
GetPosition (self)
Returns the x, y position of the joystick.
Return type: | Point |
---|
GetPosition (self, axis)
Returns the position of the specified joystick axis.
Parameters: | axis (int) – The joystick axis to report, from 0 to GetNumberAxes - 1. |
---|---|
Return type: | int |
Returns the product id for the joystick.
Return type: | int |
---|
Returns the product name for the joystick.
Return type: | string |
---|
Returns the maximum rudder position.
Return type: | int |
---|
Returns the minimum rudder position.
Return type: | int |
---|
Returns the rudder position.
Return type: | int |
---|
Returns the maximum U position.
Return type: | int |
---|
Returns the minimum U position.
Return type: | int |
---|
Gets the position of the fifth axis of the joystick, if it exists.
Return type: | int |
---|
Returns the maximum V position.
Return type: | int |
---|
Returns the minimum V position.
Return type: | int |
---|
Gets the position of the sixth axis of the joystick, if it exists.
Return type: | int |
---|
Returns the maximum x position.
Return type: | int |
---|
Returns the minimum x position.
Return type: | int |
---|
Returns the maximum y position.
Return type: | int |
---|
Returns the minimum y position.
Return type: | int |
---|
Returns the maximum z position.
Return type: | int |
---|
Returns the minimum z position.
Return type: | int |
---|
Returns the z position of the joystick.
Return type: | int |
---|
Returns True if the joystick has a point of view control.
Return type: | bool |
---|
Returns True if the joystick point-of-view supports discrete values (centered, forward, backward, left, and right).
Return type: | bool |
---|
Returns True if the joystick point-of-view supports continuous degree bearings.
Return type: | bool |
---|
Returns True if there is a rudder attached to the computer.
Return type: | bool |
---|
Returns True if the joystick has a U axis.
Return type: | bool |
---|
Returns True if the joystick has a V axis.
Return type: | bool |
---|
Returns True if the joystick has a Z axis.
Return type: | bool |
---|
Returns True if the joystick is functioning.
Return type: | bool |
---|
Releases the capture set by SetCapture.
Return type: | bool |
---|---|
Returns: | True if the capture release succeeded. |
See also
Sets the capture to direct joystick events to win.
Parameters: |
|
---|---|
Return type: | bool |
Returns: | True if the capture succeeded. |
See also
Sets the movement threshold, the number of steps outside which the joystick is deemed to have moved.
Parameters: | threshold (int) – |
---|
See GetButtonState
See GetNumberAxes
See GetNumberButtons
See GetPOVPosition
See GetPollingMax
See GetPollingMin
See GetPosition
See GetProductId
See GetProductName
See GetRudderMax
See GetRudderMin
See GetUPosition
See GetVPosition
See GetZPosition