AsyncInput

Struct AsyncInput 

Source
pub struct AsyncInput { /* private fields */ }
Expand description

Async wrapper for agb input operations

Implementations§

Source§

impl AsyncInput

Source

pub async fn wait_for_button_press(&mut self, button: Button) -> ButtonEvent

Wait for a specific button to be pressed

Source

pub async fn wait_for_any_button_press(&mut self) -> (Button, ButtonEvent)

Wait for any button to be pressed or released

Source

pub async fn wait_for_button_press_polling( &mut self, button: Button, ) -> ButtonEvent

Wait for a specific button to be pressed using agb’s ButtonController

Source

pub async fn wait_for_any_button_press_polling( &mut self, ) -> (Button, ButtonEvent)

Wait for any button to be pressed using agb’s ButtonController

Source

pub fn update(&mut self)

Get current button state (non-blocking)

Source

pub fn is_pressed(&self, button: Button) -> bool

Check if a button is currently pressed

Source

pub fn is_pressed_polling(&self, button: Button) -> bool

Check if a button is currently pressed using agb’s ButtonController

Source

pub fn is_just_pressed_polling(&self, button: Button) -> bool

Check if a button was just pressed this frame using agb’s ButtonController

Source

pub fn x_tri(&self) -> Tri

Get the tri-state for directional inputs (non-blocking)

Source

pub fn y_tri(&self) -> Tri

Get the tri-state for directional inputs (non-blocking)

Auto Trait Implementations§

§

impl Freeze for AsyncInput

§

impl RefUnwindSafe for AsyncInput

§

impl Send for AsyncInput

§

impl Sync for AsyncInput

§

impl Unpin for AsyncInput

§

impl UnwindSafe for AsyncInput

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where 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>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.