[−][src]Struct blinds::event_cache::EventCache
A struct that stores all input event values
While this is mostly takes care of book keeping necessary to store input event state, it also handles cases like the window losing focus (which should completely reset input state).
It is capable of tracking individual pointer
s and gamepad
s, as well as the global
key
state and mouse
.
Implementations
impl EventCache
[src]
pub fn new() -> EventCache
[src]
pub fn process_event(&mut self, event: &Event)
[src]
Take an event and update the internal state to reflect it
pub fn clear(&mut self)
[src]
Clear all of the state
pub fn key(&self, key: Key) -> bool
[src]
Check if a given key is down
pub fn mouse(&self) -> &PointerState
[src]
The state of the global mouse
Under a system with touch input or with multiple cursors, this may report erratic results. The state here is tracked for every pointer event, regardless of pointer ID.
pub fn pointer(&self, id: &PointerId) -> Option<&PointerState>
[src]
The state of the given pointer
pub fn pointers(&self) -> impl Iterator<Item = (&PointerId, &PointerState)>
[src]
The pointer ID and values that have been tracked
pub fn gamepad(&self, id: &GamepadId) -> Option<&GamepadState>
[src]
The state of the given gamepad
pub fn gamepads(&self) -> impl Iterator<Item = (&GamepadId, &GamepadState)>
[src]
The gamepad ID and values that have been tracked
Trait Implementations
impl Default for EventCache
[src]
fn default() -> EventCache
[src]
Auto Trait Implementations
impl RefUnwindSafe for EventCache
impl Send for EventCache
impl Sync for EventCache
impl Unpin for EventCache
impl UnwindSafe for EventCache
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,