Current cursor position in logical drawing coordinates.
Mouse
:= []
Mouse module - helpers for working with Host.mouse button state.
The host stores one packed state byte per raylib mouse button code 0-6:
bit 0 is held, bit 1 is pressed this frame, and bit 2 is released this frame.
Pass host.mouse directly to these helpers.
Cursor movement since the previous frame, sampled once by the host.
wheel_delta : { ..state, wheel_x : F32, wheel_y : F32 } -> { x : F32, y : F32 }
Horizontal and vertical wheel movement sampled for this frame.
button_down : { ..state, buttons : List(U8) }, MouseButton -> Bool
Check if a mouse button is currently held down.
Check if a mouse button is currently up.
button_pressed : { ..state, buttons : List(U8) }, MouseButton -> Bool
Check if a mouse button was first pressed this frame.
button_released : { ..state, buttons : List(U8) }, MouseButton -> Bool
Check if a mouse button was released this frame.
State
:= {
buttons : List(U8),
left : Bool,
middle : Bool,
right : Bool,
wheel : F32,
wheel_x : F32,
wheel_y : F32,
delta_x : F32,
delta_y : F32,
x : F32,
y : F32,
}
Mouse input sampled once at the start of the current frame.
button_down : State, MouseButton -> Bool
Whether a button is currently up.
button_pressed : State, MouseButton -> Bool
Whether a button was first pressed this frame.
button_released : State, MouseButton -> Bool
Whether a button was released this frame.
Current cursor position in logical drawing coordinates.
Cursor movement since the previous frame.
wheel_delta : State -> { x : F32, y : F32 }
Horizontal and vertical wheel movement for this frame.
Cursor
:= [
Default,
Arrow,
IBeam,
Crosshair,
PointingHand,
ResizeEastWest,
ResizeNorthSouth,
ResizeNorthwestSoutheast,
ResizeNortheastSouthwest,
ResizeAll,
NotAllowed,
]
Native operating-system cursor shapes.
MouseButton
:= [Left, Right, Middle, Side, Extra, Forward, Back]
Standard mouse buttons sampled by the platform.