Class: SDL2::Event::JoyHatMotion

Inherits:
SDL2::Event show all
Defined in:
event.c,
event.c

Overview

This class represents the joystick hat position change events.

Instance Attribute Summary collapse

Attributes inherited from SDL2::Event

#timestamp, #type

Instance Method Summary collapse

Methods inherited from SDL2::Event

enable=, enabled?, poll, #window

Instance Attribute Details

#hat ⇒ Integer

the joystick hat index

Returns:

  • (Integer)

#value ⇒ Integer

the hat position value, same value as Joystick#hat.

Returns:

  • (Integer)

#which ⇒ Integer

the joystick index

Returns:

  • (Integer)

Instance Method Details

#inspect ⇒ String

Returns inspection string.

Returns:

  • (String) —

    inspection string



763
764
765
766
767
768
769
# File 'event.c', line 763

static VALUE EvJoyHatMotion_inspect(VALUE self)
{
    SDL_Event* ev; TypedData_Get_Struct(self, SDL_Event, &SDL_Event_data_type, ev);
    return rb_sprintf("<%s: type=%u timestamp=%u which=%d hat=%u value=%u>",
                      rb_obj_classname(self), ev->common.type, ev->common.timestamp,
                      ev->jhat.which, ev->jhat.hat, ev->jhat.value);
}