Module: SDL2::TextInput
- Defined in:
- key.c,
key.c
Overview
This module provides Unicode text input support.
Normally, you can handle key inputs from key events and Key module. This module is required to input thousands kinds of symbols like CJK languages. Please see https://wiki.libsdl.org/Tutorials/TextInput to understand the concept of Unicode text input.
Class Method Summary collapse
-
.active? ⇒ Boolean
Return true if Unicode text input events are enabled.
-
.rect=(rect) ⇒ rect
Set the rectanlgle used to type Unicode text inputs.
-
.start ⇒ nil
Enable Unicode input events.
-
.stop ⇒ nil
Disable Unicode input events.
Class Method Details
.active? ⇒ Boolean
Return true if Unicode text input events are enabled.
189 190 191 192 |
# File 'key.c', line 189
static VALUE TextInput_s_active_p(VALUE self)
{
return INT2BOOL(SDL_IsTextInputActive());
}
|
.rect=(rect) ⇒ rect
225 226 227 228 229 230 |
# File 'key.c', line 225
static VALUE TextInput_s_set_rect(VALUE self, VALUE rect)
{
SDL_Rect *r = Get_SDL_Rect(rect);
SDL_SetTextInputRect(r);
return rect;
}
|
.start ⇒ nil
Enable Unicode input events.
201 202 203 204 |
# File 'key.c', line 201
static VALUE TextInput_s_start(VALUE self)
{
SDL_StartTextInput(); return Qnil;
}
|
.stop ⇒ nil
Disable Unicode input events.
213 214 215 216 |
# File 'key.c', line 213
static VALUE TextInput_s_stop(VALUE self)
{
SDL_StopTextInput(); return Qnil;
}
|