1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. _wx.JoystickEvent:
==========================================================================================================================================
|phoenix_title| **wx.JoystickEvent**
==========================================================================================================================================
This event class contains information about joystick events, particularly events received by windows.
^^
.. _JoystickEvent-events:
|events| Events Emitted by this Class
=====================================
Handlers bound for the following event types will receive a :ref:`wx.JoystickEvent` parameter.
Event macros:
- EVT_JOY_BUTTON_DOWN: Process a ``wxEVT_JOY_BUTTON_DOWN`` event.
- EVT_JOY_BUTTON_UP: Process a ``wxEVT_JOY_BUTTON_UP`` event.
- EVT_JOY_MOVE: Process a ``wxEVT_JOY_MOVE`` event.
- EVT_JOY_ZMOVE: Process a ``wxEVT_JOY_ZMOVE`` event.
- EVT_JOYSTICK_EVENTS: Processes all joystick events. ^^
.. seealso:: :ref:`wx.adv.Joystick`
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html
<div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
<img id="toggleBlock-trigger" src="_static/images/closed.png"/>
Inheritance diagram for class <strong>JoystickEvent</strong>:
</div>
<div id="toggleBlock-summary" style="display:block;"></div>
<div id="toggleBlock-content" style="display:none;">
<p class="graphviz">
<center><img src="_static/images/inheritance/wx.JoystickEvent_inheritance.png" alt="Inheritance diagram of JoystickEvent" usemap="#dummy" class="inheritance"/></center>
<script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
<map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.JoystickEvent.html" title="wx.JoystickEvent" alt="" coords="5,160,139,189"/> <area shape="rect" id="node2" href="wx.Event.html" title="wx.Event" alt="" coords="31,83,113,112"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="29,5,115,35"/> </map>
</p>
</div>
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.JoystickEvent.__init__` Constructor.
:meth:`~wx.JoystickEvent.ButtonDown` Returns ``True`` if the event was a down event from the specified button (or any button).
:meth:`~wx.JoystickEvent.ButtonIsDown` Returns ``True`` if the specified button (or any button) was in a down state.
:meth:`~wx.JoystickEvent.ButtonUp` Returns ``True`` if the event was an up event from the specified button (or any button).
:meth:`~wx.JoystickEvent.GetButtonChange` Returns the identifier of the button changing state.
:meth:`~wx.JoystickEvent.GetButtonOrdinal` Returns the 0-indexed ordinal of the button changing state.
:meth:`~wx.JoystickEvent.GetButtonState` Returns the down state of the buttons.
:meth:`~wx.JoystickEvent.GetJoystick` Returns the identifier of the joystick generating the event - one of ``wx.JOYSTICK1`` and ``wx.JOYSTICK2``.
:meth:`~wx.JoystickEvent.GetPosition` Returns the x, y position of the joystick event.
:meth:`~wx.JoystickEvent.GetZPosition` Returns the z position of the joystick event.
:meth:`~wx.JoystickEvent.IsButton` Returns ``True`` if this was a button up or down event (`not` 'is any button down?').
:meth:`~wx.JoystickEvent.IsMove` Returns ``True`` if this was an x, y move event.
:meth:`~wx.JoystickEvent.IsZMove` Returns ``True`` if this was a z move event.
================================================================================ ================================================================================
|
|property_summary| Properties Summary
=====================================
================================================================================ ================================================================================
:attr:`~wx.JoystickEvent.ButtonChange` See :meth:`~wx.JoystickEvent.GetButtonChange`
:attr:`~wx.JoystickEvent.ButtonOrdinal` See :meth:`~wx.JoystickEvent.GetButtonOrdinal`
:attr:`~wx.JoystickEvent.ButtonState` See :meth:`~wx.JoystickEvent.GetButtonState`
:attr:`~wx.JoystickEvent.Joystick` See :meth:`~wx.JoystickEvent.GetJoystick`
:attr:`~wx.JoystickEvent.Position` See :meth:`~wx.JoystickEvent.GetPosition`
:attr:`~wx.JoystickEvent.ZPosition` See :meth:`~wx.JoystickEvent.GetZPosition`
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.JoystickEvent(Event)
**Possible constructors**::
JoystickEvent(eventType=wxEVT_NULL, state=0, joystick=JOYSTICK1,
change=0)
This event class contains information about joystick events,
particularly events received by windows.
.. method:: __init__(self, eventType=wxEVT_NULL, state=0, joystick=JOYSTICK1, change=0)
Constructor.
:param `eventType`:
:type `eventType`: wx.EventType
:param `state`:
:type `state`: int
:param `joystick`:
:type `joystick`: int
:param `change`:
:type `change`: int
.. method:: ButtonDown(self, button=JOY_BUTTON_ANY)
Returns ``True`` if the event was a down event from the specified button (or any button).
:param `button`: Can be ``JOY_BUTTONn`` where ``n`` is 1, 2, 3 or 4; or ``JOY_BUTTON_ANY`` to indicate any button down event.
:type `button`: int
:rtype: `bool`
.. method:: ButtonIsDown(self, button=JOY_BUTTON_ANY)
Returns ``True`` if the specified button (or any button) was in a down state.
:param `button`: Can be ``JOY_BUTTONn`` where ``n`` is 1, 2, 3 or 4; or ``JOY_BUTTON_ANY`` to indicate any button down event.
:type `button`: int
:rtype: `bool`
.. method:: ButtonUp(self, button=JOY_BUTTON_ANY)
Returns ``True`` if the event was an up event from the specified button (or any button).
:param `button`: Can be ``JOY_BUTTONn`` where ``n`` is 1, 2, 3 or 4; or ``JOY_BUTTON_ANY`` to indicate any button down event.
:type `button`: int
:rtype: `bool`
.. method:: GetButtonChange(self)
Returns the identifier of the button changing state.
The return value is::
1 << n
where ``n`` is the index of the button changing state, which can also be retrieved using :meth:`GetButtonOrdinal` .
Note that for ``n`` equal to 1, 2, 3 or 4 there are predefined ``JOY_BUTTONn`` constants which can be used for more clarity, however these constants are not defined for the buttons beyond the first four.
:rtype: `int`
.. method:: GetButtonOrdinal(self)
Returns the 0-indexed ordinal of the button changing state.
:rtype: `int`
.. versionadded:: 4.1/wxWidgets-3.1.2 .
.. seealso:: :meth:`GetButtonChange`
.. method:: GetButtonState(self)
Returns the down state of the buttons.
This is a ``JOY_BUTTONn`` identifier, where ``n`` is one of 1, 2, 3, 4.
:rtype: `int`
.. method:: GetJoystick(self)
Returns the identifier of the joystick generating the event - one of ``wx.JOYSTICK1`` and ``wx.JOYSTICK2``.
:rtype: `int`
.. method:: GetPosition(self)
Returns the x, y position of the joystick event.
These coordinates are valid for all the events except wxEVT_JOY_ZMOVE.
:rtype: :ref:`wx.Point`
.. method:: GetZPosition(self)
Returns the z position of the joystick event.
This method can only be used for wxEVT_JOY_ZMOVE events.
:rtype: `int`
.. method:: IsButton(self)
Returns ``True`` if this was a button up or down event (`not` 'is any button down?').
:rtype: `bool`
.. method:: IsMove(self)
Returns ``True`` if this was an x, y move event.
:rtype: `bool`
.. method:: IsZMove(self)
Returns ``True`` if this was a z move event.
:rtype: `bool`
.. attribute:: ButtonChange
See :meth:`~wx.JoystickEvent.GetButtonChange`
.. attribute:: ButtonOrdinal
See :meth:`~wx.JoystickEvent.GetButtonOrdinal`
.. attribute:: ButtonState
See :meth:`~wx.JoystickEvent.GetButtonState`
.. attribute:: Joystick
See :meth:`~wx.JoystickEvent.GetJoystick`
.. attribute:: Position
See :meth:`~wx.JoystickEvent.GetPosition`
.. attribute:: ZPosition
See :meth:`~wx.JoystickEvent.GetZPosition`
|