Link Search Menu Expand Document

Variable short

Byte transformations

Event Keyboard

Keyboard event packet is sent every client cycle when there has been at least one keypress done. Multiple key presses are sent in one packet, if multiple keys had been pressed in that time.

Payload

The packet is encoded in a loop, writing the number of milliseconds that have passed since the last keypress, as well as the keycode pressed in each iteration. The server decodes the packet by first determining the size of the packet, by dividing the size of the payload by 4, as that is how many bytes the two variables combined consume.

Type Description
Unsigned Medium Milliseconds since last keypress, capped to a value of 16,777,215.
Unsigned Byte Encoded keycode.