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: 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: Always returns an
ExternalError::NotSupported
.
Trait Implementations
sourceimpl Clone for CursorGrabMode
impl Clone for CursorGrabMode
sourcefn clone(&self) -> CursorGrabMode
fn clone(&self) -> CursorGrabMode
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CursorGrabMode
impl Debug for CursorGrabMode
sourceimpl<'de> Deserialize<'de> for CursorGrabMode
impl<'de> Deserialize<'de> for CursorGrabMode
sourcefn 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
sourceimpl Hash for CursorGrabMode
impl Hash for CursorGrabMode
sourceimpl PartialEq<CursorGrabMode> for CursorGrabMode
impl PartialEq<CursorGrabMode> for CursorGrabMode
sourceimpl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more