| Class | Rubygame::Events::JoystickHatMoved |
| In: |
lib/rubygame/events/joystick_events.rb
|
| Parent: | Object |
JoystickHatMoved is an event that occurs when a joystick‘s hat switch has changed direction.
A joystick hat switch is a round switch that can be pressed in 8 possible directions: up, down, left, right, or the four diagonal directions. (Some hat switches support extra diagonal directions, but only those 8 directions are supported by Rubygame.)
| direction | [R] | |
| hat | [R] | |
| horizontal | [R] | |
| joystick_id | [R] | |
| vertical | [R] |
Creates a new JoystickHatMoved instance.
| joystick_id: | an integer identifying which joystick changed. The first joystick is 0. |
| hat: | an integer identifying which hat switch changed. The first hat switch on each joystick is 0. |
| direction: | a symbol telling the direction the hat switch is being pressed. The
direction is either nil or one of these 8 symbols:
:up :up_right :right :down_right :down :down_left :left :up_left |