[][src]Struct quicksilver::input::Input

pub struct Input { /* fields omitted */ }

The source of events and input device state

Implementations

impl Input[src]

pub async fn next_event<'_>(&'_ mut self) -> Option<Event>[src]

Retrieve the next event from the environment, or wait until there is one

If an event has occured since this method was last called, it will be return as Some(event). Once all events have been handled, None will be returned. At this point you should run any update or drawing logic in your app. When this method is called after it returns None, it will yield control back to the environment until your app should run again.

impl Input[src]

pub fn key_down(&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

Auto Trait Implementations

impl !RefUnwindSafe for Input

impl !Send for Input

impl !Sync for Input

impl Unpin for Input

impl !UnwindSafe for Input

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.