Text Input
There are many ways a user can input text in your game, for example using a keyboard, an on-screen keyboard or a virtual keyboard such as on mobile devices.
TextInputEvent
The cer::TextInputEvent
is raised when the user has pressed any physical or virtual key that produced a Unicode character.
To capture it, handle the event just like any other:
On-screen keyboards
To show or hide the system’s on-screen keyboard, use the Window::activateOnScreenKeyboard()
and
Window::deactivateOnScreenKeyboard()
methods, respectively.
Typing on an on-screen keyboard will produce TextInputEvent
events.
On-screen keyboards are typically a mobile-only feature. If the system doesn’t support on-screen keyboards, calling these functions won’t have any effect.