pub struct InputSnapshot { /* private fields */ }Expand description
Held controls and transitions accumulated for the next simulation-bearing frame.
Implementations§
Source§impl InputSnapshot
impl InputSnapshot
Sourcepub const fn focused(&self) -> bool
pub const fn focused(&self) -> bool
Returns whether the application window currently has keyboard focus.
Sourcepub const fn pointer_position(&self) -> Option<LogicalPosition>
pub const fn pointer_position(&self) -> Option<LogicalPosition>
Returns the latest known pointer position in logical window coordinates.
Sourcepub fn key_pressed(&self, key: KeyCode) -> bool
pub fn key_pressed(&self, key: KeyCode) -> bool
Returns whether key became pressed since transient input was last consumed.
Sourcepub fn key_released(&self, key: KeyCode) -> bool
pub fn key_released(&self, key: KeyCode) -> bool
Returns whether key became released since transient input was last consumed.
Returns whether button is currently held.
Returns whether button became pressed since transient input was last consumed.
Returns whether button became released since transient input was last consumed.
Sourcepub fn scroll(&self) -> &[ScrollSample]
pub fn scroll(&self) -> &[ScrollSample]
Returns ordered scroll transitions accumulated since transient input was last consumed.
Trait Implementations§
Source§impl Debug for InputSnapshot
impl Debug for InputSnapshot
Auto Trait Implementations§
impl Freeze for InputSnapshot
impl RefUnwindSafe for InputSnapshot
impl Send for InputSnapshot
impl Sync for InputSnapshot
impl Unpin for InputSnapshot
impl UnsafeUnpin for InputSnapshot
impl UnwindSafe for InputSnapshot
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