pub struct Gamepad { /* private fields */ }Expand description
Virtual gamepad device
Implementations§
Source§impl Gamepad
impl Gamepad
Sourcepub fn press(&mut self, button: GamepadButton) -> Result<()>
pub fn press(&mut self, button: GamepadButton) -> Result<()>
Press button(s)
Sourcepub fn release(&mut self, button: GamepadButton) -> Result<()>
pub fn release(&mut self, button: GamepadButton) -> Result<()>
Release button(s)
Sourcepub fn tap(&mut self, button: GamepadButton) -> Result<()>
pub fn tap(&mut self, button: GamepadButton) -> Result<()>
Tap button (press and release)
Sourcepub fn set_left_stick(&mut self, x: u8, y: u8) -> Result<()>
pub fn set_left_stick(&mut self, x: u8, y: u8) -> Result<()>
Set left stick position (0-255, 128 = center)
Sourcepub fn set_right_stick(&mut self, x: u8, y: u8) -> Result<()>
pub fn set_right_stick(&mut self, x: u8, y: u8) -> Result<()>
Set right stick position (0-255, 128 = center)
Sourcepub fn set_left_trigger(&mut self, value: u8) -> Result<()>
pub fn set_left_trigger(&mut self, value: u8) -> Result<()>
Set left trigger (0-255)
Sourcepub fn set_right_trigger(&mut self, value: u8) -> Result<()>
pub fn set_right_trigger(&mut self, value: u8) -> Result<()>
Set right trigger (0-255)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Gamepad
impl !RefUnwindSafe for Gamepad
impl Send for Gamepad
impl Sync for Gamepad
impl Unpin for Gamepad
impl UnsafeUnpin 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