class Rubygame::JoyHatEvent

Indicates that a Joystick POV hat was moved.

This event has these attributes:

joynum

the identifier number of the affected Joystick.

hat

the identifier number of the hat.

value

the new direction of the hat, one of these constants in module Rubygame (or the corresponding number):

HAT_CENTERED

0

HAT_UP

1

HAT_RIGHT

2

HAT_DOWN

4

HAT_LEFT

8

HAT_RIGHTUP

3

HAT_RIGHTDOWN

6

HAT_LEFTUP

9

HAT_LEFTDOWN

12

Attributes

hat[RW]
joynum[RW]
value[RW]

Public Class Methods

new(joy,hat,value) click to toggle source
# File lib/rubygame/event.rb, line 362
def initialize(joy,hat,value)
        # eventually, joy could be int OR a Rubygame::Joystick instance,
        # which would be stored as joy or maybe joyinstance?
        @joynum = joy
        @hat, @value = hat, value
end