pub struct InputSnapshot { /* private fields */ }Expand description
Held controls and transitions accumulated for one game 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 during the current frame.
Sourcepub fn key_released(&self, key: KeyCode) -> bool
pub fn key_released(&self, key: KeyCode) -> bool
Returns whether key became released during the current frame.
Returns whether button is currently held.
Returns whether button became pressed during the current frame.
Returns whether button became released during the current frame.
Sourcepub fn scroll(&self) -> &[ScrollSample]
pub fn scroll(&self) -> &[ScrollSample]
Returns the ordered scroll transitions accumulated during the current frame.
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