onKeyEvent

inline fun <T : Actor> T.onKeyEvent(catchEvent: Boolean = false, crossinline listener: T.(event: InputEvent, character: Char) -> Unit): EventListener

Attaches an EventListener optimized to listen for keyTyped type events fired for this actor.

Return

EventListener instance.

Parameters

catchEvent

if true, the event will not be passed further after it is handled by this listener. Defaults to false.

listener

invoked each time this actor is keyboard-focused and a key is typed. Consumes the triggered InputEvent, the typed character, and the Actor that the listener was originally attached to as this.