wxJoystickEvent(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

πŸ’– wxJoystickEvent πŸ’–

okay bestie, welcome to the wxJoystickEvent page β€” it's an Erlang module definition, and it's literally all about joystick events. You know, the stuff that happens when someone wiggles a stick or mashes a button and a window goes "oh!! heard!!" πŸ•ΉοΈβœ¨


πŸŽ€ DESCRIPTION πŸŽ€

This class is derived, and can use functions, from:

  • wxEvent

wxWidgets docs: wxJoystickEvent

Events

Use wxEvtHandler:connect/3 with wxJoystickEventType to subscribe to events of this type. That's your ticket in, no cap. 🎟️


✨ DATA TYPES ✨

  • wxJoystick() :: #wxJoystick{}.
  • wxJoystickEvent() :: wx:wx_object().
  • wxJoystickEventType() :: joy_button_down | joy_button_up | joy_move | joy_zmove.

four whole event flavours, and every single one of them slays πŸ¦‹


🌸 FUNCTIONS 🌸

buttonDown(This, [Option]) -> boolean()

buttonDown(This, [Option]) -> boolean()
                    when
                        This :: wxJoystickEvent(),
                        Option :: {but, integer()}.

Returns true if the event was a down event from the specified button (or any button). any button, we're not picky πŸ’…


buttonIsDown(This, [Option]) -> boolean()

buttonIsDown(This, [Option]) -> boolean()
                      when
                          This :: wxJoystickEvent(),
                          Option :: {but, integer()}.

Returns true if the specified button (or any button) was in a down state.


buttonUp(This, [Option]) -> boolean()

buttonUp(This, [Option]) -> boolean()
                    when
                        This :: wxJoystickEvent(),
                        Option :: {but, integer()}.

Returns true if the event was an up event from the specified button (or any button). the lil release moment 🫢


getButtonChange(This) -> integer()

getButtonChange(This) -> integer() when This :: wxJoystickEvent().

Returns the identifier of the button changing state.

The return value is where n is the index of the button changing state, which can also be retrieved using GetButtonOrdinal() (not implemented in wx).

⚠️ heads up bestie: for n equal to 1, 2, 3 or 4 there are predefined wxJOY_BUTTONn constants which can be used for more clarity, however these constants are not defined for the buttons beyond the first four. so like… button five is on its own fr fr 😭

getButtonState(This) -> integer()

getButtonState(This) -> integer() when This :: wxJoystickEvent().

Returns the down state of the buttons.

This is a wxJOY_BUTTONn identifier, where n is one of 1, 2, 3, 4.


getJoystick(This) -> integer()

getJoystick(This) -> integer() when This :: wxJoystickEvent().

Returns the identifier of the joystick generating the event β€” one of wxJOYSTICK1 and wxJOYSTICK2. which one of the two little guys did it πŸ‘€


getPosition(This) -> {X :: integer(), Y :: integer()}

getPosition(This) -> {X :: integer(), Y :: integer()}
                     when This :: wxJoystickEvent().

Returns the x, y position of the joystick event.

These coordinates are valid for all the events except wxEVT_JOY_ZMOVE. so if it's a z-move, don't come looking here for your x/y, it's not giving map coordinates πŸ—ΊοΈπŸ’€

getZPosition(This) -> integer()

getZPosition(This) -> integer() when This :: wxJoystickEvent().

Returns the z position of the joystick event.

This method can only be used for wxEVT_JOY_ZMOVE events. exclusive behaviour, main character energy only πŸ”₯


isButton(This) -> boolean()

isButton(This) -> boolean() when This :: wxJoystickEvent().

Returns true if this was a button up or down event (not 'is any button down?'). read the question carefully bestie, it's asking about the event type, not the button's feelings πŸ™ˆ


isMove(This) -> boolean()

isMove(This) -> boolean() when This :: wxJoystickEvent().

Returns true if this was an x, y move event. ✨


isZMove(This) -> boolean()

isZMove(This) -> boolean() when This :: wxJoystickEvent().

Returns true if this was a z move event. πŸ¦‹


and that's the whole page, periodt πŸ’… every function, every default, every little constant accounted for, we don't skip and we don't summarise in this house πŸ’–

this blessed lil page came to you from Ericsson AB, it's wx 2.6 energy, and yeah β€” we're talking wxJoystickEvent, the third section because we're fancy like that. byeee, go subscribe to some joystick events bestie πŸŽ€βœ¨πŸŒˆ

πŸ“¦ where this page comes from