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) ⇒ void
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.
191 192 193 194 |
# File 'key.c', line 191
static VALUE TextInput_s_active_p(VALUE self)
{
return INT2BOOL(SDL_IsTextInputActive());
}
|
.rect=(rect) ⇒ void
227 228 229 230 231 232 |
# File 'key.c', line 227
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.
203 204 205 206 |
# File 'key.c', line 203
static VALUE TextInput_s_start(VALUE self)
{
SDL_StartTextInput(); return Qnil;
}
|
.stop ⇒ nil
Disable Unicode input events.
215 216 217 218 |
# File 'key.c', line 215
static VALUE TextInput_s_stop(VALUE self)
{
SDL_StopTextInput(); return Qnil;
}
|