MousePosChange

class MousePosChange(val packed: Long)

A class for mouse position changes, packed into a primitive long. We utilize bitpacking in order to use primitive long arrays for space constraints.

Constructors

Link copied to clipboard
constructor(timeDelta: Int, xDelta: Int, yDelta: Int)
constructor(timeDelta: Int, xDelta: Int, yDelta: Int, lastMouseButton: Int)
constructor(packed: Long)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

the last mouse button that was clicked shortly before the mouse movement. Value 0 means no recent click, 2 means left mouse click, 8 means right mouse click and 14 means middle mouse click. Other buttons are unknown but may also be possible. The value is 0xFFFF if no mouse button property is included, which is the case for the java variant of this packet.

Link copied to clipboard

the bitpacked long value, exposed as servers may wish to re-compose the position changes at a later date.

Link copied to clipboard

the time difference in milliseconds since the last transmitted mouse movement.

Link copied to clipboard
val xDelta: Int

the x coordinate delta of the mouse, in pixels. If the mouse goes outside the client window, the value will be -1.

Link copied to clipboard
val yDelta: Int

the y coordinate delta of the mouse, in pixels. If the mouse goes outside the client window, the value will be -1.

Functions

Link copied to clipboard
open override fun toString(): String