Event Keyboard
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.
Types
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.