pub enum CursorGrabMode {
None,
Confined,
Locked,
}Expand description
Pointer confinement for the host window, the winit and Bevy
CursorGrabMode set. Apps declare it per frame through
cursor_grab.
Confined is the one that means “the mouse cannot escape the
window”: the OS keeps the pointer inside its bounds while the
cursor stays visible. Locked additionally hides it and reports
movement without bounds (FPS mouselook); platforms that cannot
lock fall back to confining in the runners.
The web is the odd one out: Locked drives pointer lock (which a
browser grants only after a user gesture) and Confined has no
equivalent, so it stays free.
Variants§
None
The pointer moves freely, in and out of the window.
Confined
The pointer cannot leave the window. Still drawn and still reaches every pixel inside, so absolute-position controls (a paddle, a drag) keep working at the window edge.
Locked
The pointer is hidden and pinned to the window, reporting relative movement only.