Class: SDL2::Event::ControllerDevice

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

Overview

This class represents controller device events (connected/disconnected/remapped).

The event of this event doesn’t occur. Only the event of the following subclasses occur in Ruby/SDL2.

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

#whichInteger

the controller index

Returns:

  • (Integer)

Instance Method Details

#inspectString

Returns inspection string

Returns:

  • (String)

    inspection string



894
895
896
897
898
899
900
# File 'event.c', line 894

static VALUE ControllerDevice_inspect(VALUE self)
{
    SDL_Event* ev; Data_Get_Struct(self, SDL_Event, ev);
    return rb_sprintf("<%s: type=%u timestamp=%u which=%d>",
                      rb_obj_classname(self), ev->common.type, ev->common.timestamp,
                      ev->cdevice.which);
}