pub struct Gamepad(/* private fields */);
Expand description
An individual gamepad/controller.
Implementations§
Source§impl Gamepad
impl Gamepad
Sourcepub fn index(&self) -> i32
pub fn index(&self) -> i32
An auto-incrementing integer to uniquely identify a connected Gamepad.
Sourcepub fn connected(&self) -> bool
pub fn connected(&self) -> bool
Is this gamepad connected to the system, powered on, and usable?
Sourcepub fn mapping(&self) -> GamepadMappingType
pub fn mapping(&self) -> GamepadMappingType
The mapping in use for this device.
Array of button states for all buttons of the gamepad.
Trait Implementations§
Source§impl InstanceOf for Gamepad
impl InstanceOf for Gamepad
Source§impl ReferenceType for Gamepad
impl ReferenceType for Gamepad
Source§unsafe fn from_reference_unchecked(reference: Reference) -> Self
unsafe fn from_reference_unchecked(reference: Reference) -> Self
Converts a given reference into a concrete reference-like wrapper.
Doesn’t do any type checking; highly unsafe to use!
impl Eq for Gamepad
impl JsSerialize 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