onKeyDown
inline fun <T : Actor> T.onKeyDown(catchEvent: Boolean = false, crossinline listener: T.(keyCode: Int) -> Unit): EventListener
Attaches an EventListener optimized to listen for keyDown
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 pressed. Consumes the pressed key code and the Actor as this
.
See also
Input.Keys