Class: SDL2::Event::TextEditing

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

Overview

This class represents text editing event.

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

#lengthInteger

the length of selected editing text

Returns:

  • (Integer)

#startInteger

the start cursor of selected editing text

Returns:

  • (Integer)

#textString

the editing text

Returns:

  • (String)

#window_idInteger

the associate window id

Returns:

  • (Integer)

Instance Method Details

#inspectString

Returns inspection string.

Returns:

  • (String)

    inspection string



417
418
419
420
421
422
423
424
# File 'ext/sdl2_ext/event.c', line 417

static VALUE EvTextEditing_inspect(VALUE self)
{
    SDL_Event* ev; Data_Get_Struct(self, SDL_Event, ev);
    return rb_sprintf("<%s: type=%u timestamp=%u"
                      " window_id=%u text=%s start=%d length=%d>",
                      rb_obj_classname(self), ev->common.type, ev->common.timestamp,
                      ev->edit.windowID, ev->edit.text, ev->edit.start, ev->edit.length);
}