Class: SDL2::Event::ControllerButton

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

Direct Known Subclasses

ControllerButtonDown, ControllerButtonUp

Instance Attribute Summary

Attributes inherited from SDL2::Event

#timestamp, #type

Instance Method Summary (collapse)

Methods inherited from SDL2::Event

enable=, enabled?, poll, #window

Instance Method Details

- (Object) inspect



804
805
806
807
808
809
810
811
812
813
# File 'event.c', line 804

static VALUE ControllerButton_inspect(VALUE self)
{
    SDL_Event* ev; Data_Get_Struct(self, SDL_Event, ev);
    return rb_sprintf("<%s: type=%u timestamp=%u"
                      " which=%d button=%s state=%s>",
                      rb_obj_classname(self), ev->common.type, ev->common.timestamp,
                      ev->cbutton.which,
                      SDL_GameControllerGetStringForButton(ev->cbutton.button),
                      INT2BOOLCSTR(ev->cbutton.state));
}