onKeyboardFocus
inline fun <T : Actor> T.onKeyboardFocus(catchEvent: Boolean = false, crossinline listener: T.(focused: Boolean) -> Unit): EventListener
Attaches an EventListener optimized to listen for keyboard focus 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
will be invoked each time keyboard focus status changes on this actor. Consumes a flag marking whether the actor is currently focused and the Actor as this
.