Class: SDL2::Event::JoyAxisMotion

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

Overview

This class represents the joystick axis motion 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

#axisInteger

the axis index

Returns:

  • (Integer)

#valueInteger

the axis value (range: -32768 to -32767, 0 for newtral)

Returns:

  • (Integer)

#whichInteger

the joystick index

Returns:

  • (Integer)

Instance Method Details

#inspectStirng

Returns inspection string

Returns:

  • (Stirng)

    inspection string



694
695
696
697
698
699
700
701
# File 'event.c', line 694

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