wx.Joystick

Inheritance diagram for wx.Joystick:



Class API

Methods

__init__(joystick=wx.JOYSTICK1)

Constructor. joystick may be one of wx.JOYSTICK1, wx.JOYSTICK2, indicating the joystick controller of interest.

Parameters:

  • joystick (int)

Returns:

wx.Joystick


GetButtonState()

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.

Returns a bitlist of wx.JOY_BUTTONn identifiers, where n is 1, 2, 3 or 4 is available for historical reasons.


Returns:

int


GetManufacturerId()

Returns the manufacturer id.


Returns:

int


GetMaxAxes()
No docstrings available for this method.

GetMaxButtons()
No docstrings available for this method.

GetMovementThreshold()

Returns the movement threshold, the number of steps outside which the joystick is deemed to have moved.


Returns:

int


GetNumberAxes()

Returns the number of axes for this joystick.


Returns:

int


GetNumberButtons()

Returns the number of buttons for this joystick.


Returns:

int


GetNumberJoysticks()

Returns the number of joysticks currently attached to the computer.


Returns:

int


GetPOVCTSPosition()

Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units.

Returns -1 on error.


Returns:

int


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.

Returns -1 on error.


Returns:

int


GetPollingMax()

Returns the maximum polling frequency.


Returns:

int


GetPollingMin()

Returns the minimum polling frequency.


Returns:

int


GetPosition()

Returns the x, y position of the joystick.


Returns:

wx.Point


GetProductId()

Returns the product id for the joystick.


Returns:

int


GetProductName()

Returns the product name for the joystick.


Returns:

string


GetRudderMax()

Returns the maximum rudder position.


Returns:

int


GetRudderMin()

Returns the minimum rudder position.


Returns:

int


GetRudderPosition()

Returns the rudder position.


Returns:

int


GetUMax()

Returns the maximum U position.


Returns:

int


GetUMin()

Returns the minimum U position.


Returns:

int


GetUPosition()

Gets the position of the fifth axis of the joystick, if it exists.


Returns:

int


GetVMax()

Returns the maximum V position.


Returns:

int


GetVMin()

Returns the minimum V position.


Returns:

int


GetVPosition()

Gets the position of the sixth axis of the joystick, if it exists.


Returns:

int


GetXMax()

Returns the maximum x position.


Returns:

int


GetXMin()

Returns the minimum x position.


Returns:

int


GetYMax()

Returns the maximum y position.


Returns:

int


GetYMin()

Returns the minimum y position.


Returns:

int


GetZMax()

Returns the maximum z position.


Returns:

int


GetZMin()

Returns the minimum z position.


Returns:

int


GetZPosition()

Returns the z position of the joystick.


Returns:

int


HasPOV()

Returns True if the joystick has a point of view control.


Returns:

bool


HasPOV4Dir()

Returns True if the joystick point-of-view supports discrete values (centered, forward, backward, left, and right).


Returns:

bool


HasPOVCTS()

Returns True if the joystick point-of-view supports continuous degree bearings.


Returns:

bool


HasRudder()

Returns True if there is a rudder attached to the computer.


Returns:

bool


HasU()

Returns True if the joystick has a U axis.


Returns:

bool


HasV()

Returns True if the joystick has a V axis.


Returns:

bool


HasZ()

Returns True if the joystick has a Z axis.


Returns:

bool


IsOk()

Returns True if the joystick is functioning.


Returns:

bool


ReleaseCapture()

Releases the capture set by SetCapture.


Returns:

bool


SetCapture(win, pollingFreq=0)

Sets the capture to direct joystick events to win.

Parameters:

  • win (wx.Window): The window that will receive joystick events.
  • pollingFreq (int): If zero, movement events are sent when above the threshold. If greater than zero, events are received every pollingFreq milliseconds.

Returns:

bool


SetMovementThreshold(threshold)

Sets the movement threshold, the number of steps outside which the joystick is deemed to have moved.

Parameters:

  • threshold (int)

Properties

ButtonState
See GetButtonState
ManufacturerId
See GetManufacturerId
MaxAxes
See GetMaxAxes
MaxButtons
See GetMaxButtons
MovementThreshold
See GetMovementThreshold and SetMovementThreshold
NumberAxes
See GetNumberAxes
NumberButtons
See GetNumberButtons
NumberJoysticks
See GetNumberJoysticks
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