pub struct GamePad { /* private fields */ }
Expand description
A tiny (4 bytes) struct that contains the state of a “virtual gamepad”. Currently mini_sdl simply maps keyboard keys to it, but in the future it will allow actual gamepads and control remapping.
Implementations§
Source§impl GamePad
impl GamePad
pub fn new() -> Self
pub fn is_pressed(&self, button: Button) -> bool
pub fn is_released(&self, button: Button) -> bool
pub fn is_just_pressed(&self, button: Button) -> bool
pub fn is_just_released(&self, button: Button) -> bool
pub fn state_to_str(&self) -> &'static str
Trait Implementations§
impl Copy for GamePad
impl StructuralPartialEq for GamePad
Auto Trait Implementations§
impl Freeze for GamePad
impl RefUnwindSafe for GamePad
impl Send for GamePad
impl Sync for GamePad
impl Unpin for GamePad
impl UnwindSafe for GamePad
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