Class: SDL2::Event::MouseMotion

Inherits:
SDL2::Event show all
Defined in:
event.c,
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

- (Integer) state

TODO:

use SDL2::Mouse::State

the current mouse state

Returns:

  • (Integer)

- (Integer) which

the mouse index

Returns:

  • (Integer)

- (Integer) window_id

the window id with mouse focus

Returns:

  • (Integer)

- (Integer) x

the x coordinate of the mouse pointer, relative to window

Returns:

  • (Integer)

- (Integer) xrel

the relative motion in the x direction

Returns:

  • (Integer)

- (Integer) y

the y coordinate of the mouse pointer, relative to window

Returns:

  • (Integer)

- (Integer) yrel

the relative motion in the y direction

Returns:

  • (Integer)

Instance Method Details

- (String) inspect

Returns inspection string

Returns:

  • (String)

    inspection string



570
571
572
573
574
575
576
577
578
579
# File 'event.c', line 570

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);
}