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