Class: SDL2::Event::MouseMotion

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

Overview

This class represents mouse 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

#stateInteger

TODO:

use SDL2::Mouse::State

the current mouse state

Returns:

  • (Integer)

#whichInteger

the mouse index

Returns:

  • (Integer)

#window_idInteger

the window id with mouse focus

Returns:

  • (Integer)

#xInteger

the x coordinate of the mouse pointer, relative to window

Returns:

  • (Integer)

#xrelInteger

the relative motion in the x direction

Returns:

  • (Integer)

#yInteger

the y coordinate of the mouse pointer, relative to window

Returns:

  • (Integer)

#yrelInteger

the relative motion in the y direction

Returns:

  • (Integer)

Instance Method Details

#inspectString

Returns inspection string.

Returns:

  • (String)

    inspection string



578
579
580
581
582
583
584
585
586
587
# File 'ext/sdl2_ext/event.c', line 578

static VALUE EvMouseMotion_inspect(VALUE self)
{
    SDL_Event* ev; Data_Get_Struct(self, SDL_Event, ev);
    return rb_sprintf("<%s: type=%u timestamp=%u"
                      " window_id=%u which=%u state=%u"
                      " x=%d y=%d xrel=%d yrel=%d>",
                      rb_obj_classname(self), ev->common.type, ev->common.timestamp,
                      ev->motion.windowID, ev->motion.which, ev->motion.state,
                      ev->motion.x, ev->motion.y, ev->motion.xrel, ev->motion.yrel);
}