pub struct InputState<A: GameAction> { /* private fields */ }Implementations§
Source§impl<A: GameAction> InputState<A>
impl<A: GameAction> InputState<A>
pub fn new() -> Self
pub fn is_gamepad_start_just_pressed(&self) -> bool
pub fn is_action_pressed(&self, action: A) -> bool
pub fn is_action_just_pressed(&self, action: A) -> bool
pub fn was_action_pressed_buffered(&self, action: A, buffer_window: f32) -> bool
pub fn is_key_pressed(&self, key: Key) -> bool
pub fn is_key_just_pressed(&self, key: Key) -> bool
pub fn is_mouse_pressed(&self, button: MouseButton) -> bool
pub fn get_move_x(&self) -> f32
pub fn get_move_y(&self) -> f32
pub fn any_keyboard_or_mouse(&self) -> bool
pub fn any_gamepad(&self) -> bool
pub fn begin_frame(&mut self, delta_time: f32)
pub fn end_frame(&mut self)
pub fn input_map_mut(&mut self) -> &mut InputMap<A>
Trait Implementations§
Source§impl<A: GameAction> Default for InputState<A>
impl<A: GameAction> Default for InputState<A>
Auto Trait Implementations§
impl<A> Freeze for InputState<A>
impl<A> RefUnwindSafe for InputState<A>where
A: RefUnwindSafe,
impl<A> Send for InputState<A>where
A: Send,
impl<A> !Sync for InputState<A>
impl<A> Unpin for InputState<A>where
A: Unpin,
impl<A> UnsafeUnpin for InputState<A>
impl<A> UnwindSafe for InputState<A>where
A: UnwindSafe,
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.