Enum winit::window::CursorGrabMode
source · pub enum CursorGrabMode {
None,
Confined,
Locked,
}
Expand description
The behavior of cursor grabbing.
Use this enum with Window::set_cursor_grab
to grab the cursor.
Variants§
None
No grabbing of the cursor is performed.
Confined
The cursor is confined to the window area.
There’s no guarantee that the cursor will be hidden. You should hide it by yourself if you want to do so.
Platform-specific
- macOS: Not implemented. Always returns
ExternalError::NotSupported
for now. - iOS / Android / Web / Orbital: Always returns an
ExternalError::NotSupported
.
Locked
The cursor is locked inside the window area to the certain position.
There’s no guarantee that the cursor will be hidden. You should hide it by yourself if you want to do so.
Platform-specific
- X11 / Windows: Not implemented. Always returns
ExternalError::NotSupported
for now. - iOS / Android / Orbital: Always returns an
ExternalError::NotSupported
.
Trait Implementations§
source§impl Clone for CursorGrabMode
impl Clone for CursorGrabMode
source§fn clone(&self) -> CursorGrabMode
fn clone(&self) -> CursorGrabMode
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CursorGrabMode
impl Debug for CursorGrabMode
source§impl<'de> Deserialize<'de> for CursorGrabMode
impl<'de> Deserialize<'de> for CursorGrabMode
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for CursorGrabMode
impl Hash for CursorGrabMode
source§impl PartialEq for CursorGrabMode
impl PartialEq for CursorGrabMode
source§fn eq(&self, other: &CursorGrabMode) -> bool
fn eq(&self, other: &CursorGrabMode) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for CursorGrabMode
impl Serialize for CursorGrabMode
impl Copy for CursorGrabMode
impl Eq for CursorGrabMode
impl StructuralEq for CursorGrabMode
impl StructuralPartialEq for CursorGrabMode
Auto Trait Implementations§
impl RefUnwindSafe for CursorGrabMode
impl Send for CursorGrabMode
impl Sync for CursorGrabMode
impl Unpin for CursorGrabMode
impl UnwindSafe for CursorGrabMode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more