skrypton-api / com.waicool20.skrypton.sikulix.input / SKryptonKeyboard

SKryptonKeyboard

class SKryptonKeyboard

Class representing a virtual keyboard for a com.waicool20.skrypton.sikulix.SKryptonScreen This class is also in charge of coordinating keyboard actions between threads, unlike SKryptonRobot all functions are synchronized and thus only one thread may have access to keyboard actions.

Constructors

<init>

SKryptonKeyboard(robot: SKryptonRobot)

Main constructor

Properties

robot

val robot: SKryptonRobot

SKryptonRobot used for generating actions.

Functions

atomicAction

fun <T> atomicAction(action: () -> T): T

Executes an action atomically while keeping the synchronized lock to this object. Useful if you want to do multiple actions in one go without the possibility of a thread stealing ownership.

keyDown

fun keyDown(keycode: Int): Unit

Presses a specific key.

fun keyDown(keys: String): Unit

Presses the keys specified by the string.

keyUp

fun keyUp(): Unit

Releases all keys

fun keyUp(keycode: Int): Unit

Releases a specific key.

fun keyUp(keys: String): Unit

Releases the keys specified by the string.

type

fun type(location: Location?, text: String, modifiers: Int): Unit

Types text at a given location

Companion Object Functions

parseModifiers

fun parseModifiers(modifiers: String): Int

Parses the given modifiers string and returns corresponding KeyModifier.