pub struct MouseUtil { /* private fields */ }
Expand description
Mouse utility functions. Access with Sdl::mouse()
.
let sdl_context = sdl2::init().unwrap();
// Hide the cursor
sdl_context.mouse().show_cursor(false);
Implementations§
source§impl MouseUtil
impl MouseUtil
sourcepub fn focused_window_id(&self) -> Option<u32>
pub fn focused_window_id(&self) -> Option<u32>
Gets the id of the window which currently has mouse focus.
pub fn warp_mouse_in_window(&self, window: &Window, x: i32, y: i32)
pub fn set_relative_mouse_mode(&self, on: bool)
pub fn relative_mouse_mode(&self) -> bool
pub fn is_cursor_showing(&self) -> bool
pub fn show_cursor(&self, show: bool)
pub fn capture(&self, enable: bool)
Auto Trait Implementations§
impl Freeze for MouseUtil
impl RefUnwindSafe for MouseUtil
impl !Send for MouseUtil
impl !Sync for MouseUtil
impl Unpin for MouseUtil
impl UnwindSafe for MouseUtil
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