Class: SDL2::Event::MouseWheel

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

Overview

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

the mouse index

Returns:

  • (Integer)

- (Integer) window_id

the window id with mouse focus

Returns:

  • (Integer)

- (Integer) x

the amount of scrolled horizontally, positive to the right and negative to the left

Returns:

  • (Integer)

- (Integer) y

the amount of scrolled vertically, positve away from the user and negative toward the user

Returns:

  • (Integer)

Instance Method Details

- (String) inspect

Returns inspection string

Returns:

  • (String)

    inspection string



609
610
611
612
613
614
615
616
# File 'event.c', line 609

static VALUE EvMouseWheel_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 x=%d y=%d>",
                      rb_obj_classname(self), ev->common.type, ev->common.timestamp,
                      ev->wheel.windowID, ev->wheel.which, ev->wheel.x, ev->wheel.y);
}