UIKeyEventListener
Receives keyboard input events for UI elements.
Create in the Editor
- Ensure there is a
UIControllerin the scene. - Create a GameObject and add
UIRect. - Add the
UIKeyEventListenercomponent.
How to Use
- Get the component with
myObject.findComponent(UIKeyEventListener.class). - Read and write the component properties to control behavior.
- Test input or layout in Play mode.
Java Example
SpatialObject myObject = /* your object */;
UIKeyEventListener comp = myObject.findComponent(UIKeyEventListener.class);
if (comp != null) {
// set the keyName value:
comp.keyName = "value";
// read the keyName value:
String keyNameValue = comp.keyName;
}