KeySequence

class KeySequence(array: ByteArray)

KeySequence class represents a sequence of keys pressed in a byte array. This class provides helpful functionality to convert keys from the Jagex format back into the normalized java.awt.event.KeyEvent format.

Constructors

Link copied to clipboard
constructor(array: ByteArray)

Properties

Link copied to clipboard
val length: Int

the length of the key sequence

Functions

Link copied to clipboard

Returns the backing byte array of this key sequence, in Jagex format. It is worth noting that changes done to this array will directly modify this key sequence. All valid keys will be positive byte values.

Link copied to clipboard
fun getAwtKey(index: Int): Int

Gets the java.awt.event.KeyEvent key code at the provided index.

Link copied to clipboard
fun getAwtKeyText(index: Int): String?

Gets the java.awt.event.KeyEvent key code text at the provided index.

Link copied to clipboard
fun getJagexKey(index: Int): Int

Gets the Jagex key code at the provided index.

Link copied to clipboard

Transforms the backing key array into an int array with java.awt.event.KeyEvent key codes instead of the compressed Jagex format. Any invalid key will be represented as -1.

Link copied to clipboard

Copies this backing key array into an int array, normalizing the values in the process - all keys will be either positive integers, or -1.