wx.adv.Joystick¶
wx.adv.Joystick allows an application to control one or more joysticks.
See also
Class Hierarchy¶
Methods Summary¶
Constructor. |
|
Returns the state of the joystick buttons. |
|
Returns the manufacturer id. |
|
Returns the movement threshold, the number of steps outside which the joystick is deemed to have moved. |
|
Returns the number of axes for this joystick. |
|
Returns the number of buttons for this joystick. |
|
Returns the number of joysticks currently attached to the computer. |
|
Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units. |
|
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 the maximum polling frequency. |
|
Returns the minimum polling frequency. |
|
Returns the x, y position of the joystick. |
|
Returns the product id for the joystick. |
|
Returns the product name for the joystick. |
|
Returns the maximum rudder position. |
|
Returns the minimum rudder position. |
|
Returns the rudder position. |
|
Returns the maximum U position. |
|
Returns the minimum U position. |
|
Gets the position of the fifth axis of the joystick, if it exists. |
|
Returns the maximum V position. |
|
Returns the minimum V position. |
|
Gets the position of the sixth axis of the joystick, if it exists. |
|
Returns the maximum x position. |
|
Returns the minimum x position. |
|
Returns the maximum y position. |
|
Returns the minimum y position. |
|
Returns the maximum z position. |
|
Returns the minimum z position. |
|
Returns the z position of the joystick. |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Releases the capture set by SetCapture. |
|
Sets the capture to direct joystick events to win. |
|
Sets the movement threshold, the number of steps outside which the joystick is deemed to have moved. |
Properties Summary¶
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
Class API¶
- class wx.adv.Joystick(Object)¶
Possible constructors:
Joystick(joystick=JOYSTICK1) -> None
Joystick allows an application to control one or more joysticks.
Methods¶
- __init__(self, joystick=JOYSTICK1)¶
Constructor.
joystick may be one of
wx.JOYSTICK1
,wx.JOYSTICK2
, indicating the joystick controller of interest.- Parameters:
joystick (int)
- Return type:
None
- GetButtonState(self, *args, **kw)¶
-
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
- GetManufacturerId(self)¶
Returns the manufacturer id.
- Return type:
int
- GetMaxAxes(self)¶
- Return type:
int
- GetMaxButtons(self)¶
- Return type:
int
- GetMovementThreshold(self)¶
Returns the movement threshold, the number of steps outside which the joystick is deemed to have moved.
- Return type:
int
- GetNumberAxes(self)¶
Returns the number of axes for this joystick.
- Return type:
int
- GetNumberButtons(self)¶
Returns the number of buttons for this joystick.
- Return type:
int
- static GetNumberJoysticks()¶
Returns the number of joysticks currently attached to the computer.
- Return type:
int
- GetPOVCTSPosition(self)¶
Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units.
Returns -1 on error.
- Return type:
int
- GetPOVPosition(self)¶
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
- GetPollingMax(self)¶
Returns the maximum polling frequency.
- Return type:
int
- GetPollingMin(self)¶
Returns the minimum polling frequency.
- Return type:
int
- GetPosition(self, *args, **kw)¶
-
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
- GetProductId(self)¶
Returns the product id for the joystick.
- Return type:
int
- GetProductName(self)¶
Returns the product name for the joystick.
- Return type:
str
- GetRudderMax(self)¶
Returns the maximum rudder position.
- Return type:
int
- GetRudderMin(self)¶
Returns the minimum rudder position.
- Return type:
int
- GetRudderPosition(self)¶
Returns the rudder position.
- Return type:
int
- GetUMax(self)¶
Returns the maximum U position.
- Return type:
int
- GetUMin(self)¶
Returns the minimum U position.
- Return type:
int
- GetUPosition(self)¶
Gets the position of the fifth axis of the joystick, if it exists.
- Return type:
int
- GetVMax(self)¶
Returns the maximum V position.
- Return type:
int
- GetVMin(self)¶
Returns the minimum V position.
- Return type:
int
- GetVPosition(self)¶
Gets the position of the sixth axis of the joystick, if it exists.
- Return type:
int
- GetXMax(self)¶
Returns the maximum x position.
- Return type:
int
- GetXMin(self)¶
Returns the minimum x position.
- Return type:
int
- GetYMax(self)¶
Returns the maximum y position.
- Return type:
int
- GetYMin(self)¶
Returns the minimum y position.
- Return type:
int
- GetZMax(self)¶
Returns the maximum z position.
- Return type:
int
- GetZMin(self)¶
Returns the minimum z position.
- Return type:
int
- GetZPosition(self)¶
Returns the z position of the joystick.
- Return type:
int
- HasPOV(self)¶
Returns
True
if the joystick has a point of view control.- Return type:
bool
- HasPOV4Dir(self)¶
Returns
True
if the joystick point-of-view supports discrete values (centered, forward, backward, left, and right).- Return type:
bool
- HasPOVCTS(self)¶
Returns
True
if the joystick point-of-view supports continuous degree bearings.- Return type:
bool
- HasRudder(self)¶
Returns
True
if there is a rudder attached to the computer.- Return type:
bool
- HasU(self)¶
Returns
True
if the joystick has a U axis.- Return type:
bool
- HasV(self)¶
Returns
True
if the joystick has a V axis.- Return type:
bool
- HasZ(self)¶
Returns
True
if the joystick has a Z axis.- Return type:
bool
- IsOk(self)¶
Returns
True
if the joystick is functioning.- Return type:
bool
- ReleaseCapture(self)¶
Releases the capture set by SetCapture.
- Return type:
bool
- Returns:
True
if the capture release succeeded.
See also
- SetCapture(self, 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.
- Return type:
bool
- Returns:
True
if the capture succeeded.
See also
- SetMovementThreshold(self, threshold)¶
Sets the movement threshold, the number of steps outside which the joystick is deemed to have moved.
- Parameters:
threshold (int)
- Return type:
None
Properties¶
- ButtonState¶
See
GetButtonState
- ManufacturerId¶
- MaxAxes¶
See
GetMaxAxes
- MaxButtons¶
See
GetMaxButtons
- MovementThreshold¶
- NumberAxes¶
See
GetNumberAxes
- NumberButtons¶
See
GetNumberButtons
- POVCTSPosition¶
- 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¶
- UPosition¶
See
GetUPosition
- VPosition¶
See
GetVPosition
- ZPosition¶
See
GetZPosition