EventKeyboard

class EventKeyboard(val lastTransmittedKeyPress: Int, val keysPressed: EventKeyboard.KeySequence) : IncomingGameMessage

Keyboard events are transmitted at a maximum frequency of every 20 milliseconds. This means that - almost always - a single key is only sent in each packet, as it is very unlikely to get more than one key pressed within a 20-millisecond window, even when trying. While the packet does send the lastTransmittedKeyPress per key pressed, there is a flaw in the logic and any subsequent keys after the first will always write a value of 0. For this reason, in order to reduce the memory footprint of this message, we omit any subsequent timestamps and reduce our keys to a byte array value class for even further compression. If the time delta is greater than 16,777,215 milliseconds since the last key transmission, the lastTransmittedKeyPress value will be 16,777,215.

Constructors

Link copied to clipboard
constructor(lastTransmittedKeyPress: Int, keysPressed: EventKeyboard.KeySequence)

Types

Link copied to clipboard
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.

Properties

Link copied to clipboard
open override val category: ClientProtCategory
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String