Class: SDL2::Event::MouseMotion
- Inherits:
-
SDL2::Event
- Object
- SDL2::Event
- SDL2::Event::MouseMotion
- Defined in:
- ext/sdl2_ext/event.c,
ext/sdl2_ext/event.c
Overview
This class represents mouse motion events.
Instance Attribute Summary collapse
-
#state ⇒ Integer
the current mouse state.
-
#which ⇒ Integer
the mouse index.
-
#window_id ⇒ Integer
the window id with mouse focus.
-
#x ⇒ Integer
the x coordinate of the mouse pointer, relative to window.
-
#xrel ⇒ Integer
the relative motion in the x direction.
-
#y ⇒ Integer
the y coordinate of the mouse pointer, relative to window.
-
#yrel ⇒ Integer
the relative motion in the y direction.
Attributes inherited from SDL2::Event
Instance Method Summary collapse
-
#inspect ⇒ String
Inspection string.
Methods inherited from SDL2::Event
enable=, enabled?, poll, #window
Instance Attribute Details
#state ⇒ Integer
TODO:
use SDL2::Mouse::State
the current mouse state
#which ⇒ Integer
the mouse index
#window_id ⇒ Integer
the window id with mouse focus
#x ⇒ Integer
the x coordinate of the mouse pointer, relative to window
#xrel ⇒ Integer
the relative motion in the x direction
#y ⇒ Integer
the y coordinate of the mouse pointer, relative to window
#yrel ⇒ Integer
the relative motion in the y direction
Instance Method Details
#inspect ⇒ String
Returns 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);
}
|