KeysEvents

class KeysEvents(val view: View) : Closeable

Constructors

Link copied to clipboard
constructor(view: View)

Properties

Link copied to clipboard
Link copied to clipboard
val view: View

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
fun down(callback: suspend (key: KeyEvent) -> Unit): Closeable
fun down(key: Key, callback: suspend (key: KeyEvent) -> Unit): Closeable
fun down(vararg keys: Key, callback: suspend (key: KeyEvent) -> Unit): Closeable
fun down(keys: Set<Key>, callback: suspend (key: KeyEvent) -> Unit): Closeable
Link copied to clipboard
fun downFrame(key: Key, dt: TimeSpan = TimeSpan.NIL, callback: (ke: KeyEvent) -> Unit): Cancellable
fun downFrame(vararg keys: Key, dt: TimeSpan = TimeSpan.NIL, callback: (ke: KeyEvent) -> Unit): Cancellable

fun downFrame(keys: List<Key>, dt: TimeSpan = TimeSpan.NIL, callback: (ke: KeyEvent) -> Unit): Cancellable

Executes callback on each frame when key is being pressed. When dt is provided, the callback is executed at that dt steps.

Link copied to clipboard
fun downRepeating(    key: Key,     maxDelay: TimeSpan = 500.milliseconds,     minDelay: TimeSpan = 100.milliseconds,     delaySteps: Int = 6,     callback: suspend (ke: KeyEvent) -> Unit): Cancellable
fun downRepeating(    vararg keys: Key,     maxDelay: TimeSpan = 500.milliseconds,     minDelay: TimeSpan = 100.milliseconds,     delaySteps: Int = 6,     callback: suspend (ke: KeyEvent) -> Unit): Cancellable
fun downRepeating(    keys: Set<Key>,     maxDelay: TimeSpan = 500.milliseconds,     minDelay: TimeSpan = 100.milliseconds,     delaySteps: Int = 6,     callback: suspend (ke: KeyEvent) -> Unit): Cancellable
Link copied to clipboard
fun downWithModifiers(    key: Key,     ctrl: Boolean? = null,     shift: Boolean? = null,     alt: Boolean? = null,     meta: Boolean? = null,     callback: suspend (key: KeyEvent) -> Unit): Closeable
fun downWithModifiers(    vararg keys: Key,     ctrl: Boolean? = null,     shift: Boolean? = null,     alt: Boolean? = null,     meta: Boolean? = null,     callback: suspend (key: KeyEvent) -> Unit): Closeable
fun downWithModifiers(    keys: Set<Key>,     ctrl: Boolean? = null,     shift: Boolean? = null,     alt: Boolean? = null,     meta: Boolean? = null,     callback: suspend (key: KeyEvent) -> Unit): Closeable
Link copied to clipboard
fun justDown(key: Key, callback: (ke: KeyEvent) -> Unit): Cancellable
fun justDown(vararg keys: Key, callback: (ke: KeyEvent) -> Unit): Cancellable
fun justDown(keys: List<Key>, callback: (ke: KeyEvent) -> Unit): Cancellable
Link copied to clipboard
fun KeyEvent.setFromKeys(key: Key, keys: InputKeys, dt: TimeSpan, type: KeyEvent.Type = KeyEvent.Type.DOWN): KeyEvent
Link copied to clipboard
fun typed(callback: suspend (key: KeyEvent) -> Unit): Closeable
fun typed(key: Key, callback: suspend (key: KeyEvent) -> Unit): Closeable
fun typed(vararg keys: Key, callback: suspend (key: KeyEvent) -> Unit): Closeable
fun typed(keys: Set<Key>, callback: suspend (key: KeyEvent) -> Unit): Closeable
Link copied to clipboard
fun up(callback: suspend (key: KeyEvent) -> Unit): Closeable
fun up(key: Key, callback: suspend (key: KeyEvent) -> Unit): Closeable
fun up(vararg keys: Key, callback: suspend (key: KeyEvent) -> Unit): Closeable
fun up(keys: Set<Key>, callback: suspend (key: KeyEvent) -> Unit): Closeable
Link copied to clipboard
suspend fun KeysEvents.waitUp(key: Key): KeyEvent
suspend fun KeysEvents.waitUp(filter: (key: KeyEvent) -> Boolean = { true }): KeyEvent