Struct sdl2::keyboard::KeyboardUtil
source · pub struct KeyboardUtil { /* private fields */ }
Expand description
Keyboard utility functions. Access with Sdl::keyboard()
.
let sdl_context = sdl2::init().unwrap();
let focused = sdl_context.keyboard().focused_window_id().is_some();
Implementations§
source§impl KeyboardUtil
impl KeyboardUtil
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 keyboard focus.
pub fn mod_state(&self) -> Mod
pub fn set_mod_state(&self, flags: Mod)
Auto Trait Implementations§
impl Freeze for KeyboardUtil
impl RefUnwindSafe for KeyboardUtil
impl !Send for KeyboardUtil
impl !Sync for KeyboardUtil
impl Unpin for KeyboardUtil
impl UnwindSafe for KeyboardUtil
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