wxJoystickEvent(3erl)

πŸ’– wxJoystickEvent πŸ’–

Manual name: wxJoystickEvent(3erl) Β· Erlang Module Definition. Bestie, we're in joystick-event lore now.

🌸 NAME 🌸

wxJoystickEvent β€” functions for the wxJoystickEvent class. That's the whole assignment. πŸ’…

πŸŽ€ DESCRIPTION πŸŽ€

Okay so this event class is literally the one holding information about joystick events, particularly events received by windows. Obsessed.

See: wxJoystick (not implemented in wx).

This class is derived (and can use functions) from: wxEvent. Slay.

wxWidgets docs: wxJoystickEvent.

✨ EVENTS ✨

Use wxEvtHandler:connect/3 with wxJoystickEventType to subscribe to events of this type. No cap.

πŸ¦‹ DATA TYPES πŸ¦‹

wxJoystickEvent() = wx:wx_object()

πŸ“ wxJoystick()

wxJoystick() =
    #wxJoystick{type = wxJoystickEvent:wxJoystickEventType(),
                pos = {X :: integer(), Y :: integer()},
                zPosition = integer(),
                buttonChange = integer(),
                buttonState = integer(),
                joyStick = integer()}

πŸ“ wxJoystickEventType()

wxJoystickEventType() =
    joy_button_down | joy_button_up | joy_move | joy_zmove

πŸ’… EXPORTS πŸ’…

✨ buttonDown(This) -> boolean()

Types:

  • This = wxJoystickEvent()

✨ buttonDown(This, Options :: [Option]) -> boolean()

Types:

  • This = wxJoystickEvent()
  • Option = {but, integer()}

Returns true if the event was a down event from the specified button (or any button). Iconic.

🌸 buttonIsDown(This) -> boolean()

Types:

  • This = wxJoystickEvent()

🌸 buttonIsDown(This, Options :: [Option]) -> boolean()

Types:

  • This = wxJoystickEvent()
  • Option = {but, integer()}

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

πŸ¦‹ buttonUp(This) -> boolean()

Types:

  • This = wxJoystickEvent()

πŸ¦‹ buttonUp(This, Options :: [Option]) -> boolean()

Types:

  • This = wxJoystickEvent()
  • Option = {but, integer()}

Returns true if the event was an up event from the specified button (or any button). Slay.

πŸŽ€ getButtonChange(This) -> integer()

Types:

  • 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).

Note that 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. Iykyk.

🌈 getButtonState(This) -> integer()

Types:

  • This = wxJoystickEvent()

Returns the down state of the buttons.

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

πŸ‘‘ getJoystick(This) -> integer()

Types:

  • This = wxJoystickEvent()

Returns the identifier of the joystick generating the event - one of wxJOYSTICK1 and wxJOYSTICK2. Main character joystick energy.

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

Types:

  • This = wxJoystickEvent()

Returns the x, y position of the joystick event.

These coordinates are valid for all the events except wxEVT_JOY_ZMOVE. Noted.

🧚 getZPosition(This) -> integer()

Types:

  • This = wxJoystickEvent()

Returns the z position of the joystick event.

This method can only be used for wxEVT_JOY_ZMOVE events. Z-move exclusive.

πŸ’€ isButton(This) -> boolean()

Types:

  • This = wxJoystickEvent()

Returns true if this was a button up or down event (not 'is any button down?'). Read that twice, bestie β€” fr fr.

🌈 isMove(This) -> boolean()

Types:

  • This = wxJoystickEvent()

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

🌸 isZMove(This) -> boolean()

Types:

  • This = wxJoystickEvent()

Returns true if this was a z move event.


Footer sign-off: wxWidgets team. Β· wx 2.2.2.1 Β· wxJoystickEvent(3erl). Source/version noted β€” the footer doesn't print a separate date, so that's the exact footer tea. πŸ’…

πŸ“¦ where this page comes from