Skip to content

PluginEvent

Type

PluginEvent describes one viewport input event passed to ToolSpec.Modal.

Kind

Field
Kind: "move" | "press" | "release" | "wheel" | "key"

Kind is "move", "press", "release", "wheel", or "key".

Button

Field
Button: number

Button is 1 for left button ("press", "release", and "move" while held), 2 on "press" and "release" for a stationary right click, or 0 otherwise.

Key

Field
Key: string?

Key is "Escape", "Return", "Backspace", "Tab", "Space", "Delete", "A" to "Z", or "0" to "9" on "key", or nil otherwise.

Shift

Field
Shift: boolean

Shift is true while Shift is held.

Ctrl

Field
Ctrl: boolean

Ctrl is true while Ctrl is held.

Alt

Field
Alt: boolean

Alt is true while Alt is held.

WheelSteps

Field
WheelSteps: number

WheelSteps is the signed wheel delta (-127 to 127) on "wheel", or 0 otherwise.

RayOrigin

Field
RayOrigin: vector

RayOrigin is the world-space camera ray origin through the cursor.

RayDirection

Field
RayDirection: vector

RayDirection is the world-space unit ray direction through the cursor.

DeltaX

Field
DeltaX: number

DeltaX is horizontal cursor motion in pixels since the last press or release.

DeltaY

Field
DeltaY: number

DeltaY is vertical cursor motion in pixels since the last press or release.

Hit

Field
Hit: PluginHit?

Hit is the PluginHit for the nearest unlocked part within 1,000 units, or nil.