Struct stdweb::web::Gamepad [−][src]
pub struct Gamepad(_);
An individual gamepad/controller.
Methods
impl Gamepad
[src]
impl Gamepad
pub fn id(&self) -> String
[src]
pub fn id(&self) -> String
A string containing some information about this gamepad.
pub fn index(&self) -> i32
[src]
pub fn index(&self) -> i32
An auto-incrementing integer to uniquely identify a connected Gamepad.
pub fn connected(&self) -> bool
[src]
pub fn connected(&self) -> bool
Is this gamepad connected to the system, powered on, and usable?
pub fn timestamp(&self) -> f64
[src]
pub fn timestamp(&self) -> f64
Monotonically increasing time this gamepad was updated.
pub fn mapping(&self) -> GamepadMappingType
[src]
pub fn mapping(&self) -> GamepadMappingType
The mapping in use for this device.
pub fn axes(&self) -> Vec<f64>
[src]
pub fn axes(&self) -> Vec<f64>
Array of values for all axes of the gamepad.
Array of button states for all buttons of the gamepad.
pub fn get_all() -> Vec<Option<Gamepad>>
[src]
pub fn get_all() -> Vec<Option<Gamepad>>
Retrieve all connected gamepads, in an array indexed by each gamepad's index
member.
Chrome doesn't update Gamepad state automatically, you must call this function each frame.
Trait Implementations
impl Clone for Gamepad
[src]
impl Clone for Gamepad
fn clone(&self) -> Gamepad
[src]
fn clone(&self) -> Gamepad
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Gamepad
[src]
impl Debug for Gamepad
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Eq for Gamepad
[src]
impl Eq for Gamepad
impl PartialEq for Gamepad
[src]
impl PartialEq for Gamepad
fn eq(&self, other: &Gamepad) -> bool
[src]
fn eq(&self, other: &Gamepad) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Gamepad) -> bool
[src]
fn ne(&self, other: &Gamepad) -> bool
This method tests for !=
.
impl InstanceOf for Gamepad
[src]
impl InstanceOf for Gamepad
fn instance_of(reference: &Reference) -> bool
[src]
fn instance_of(reference: &Reference) -> bool
Checks whenever a given Reference if of type Self
.
impl AsRef<Reference> for Gamepad
[src]
impl AsRef<Reference> for Gamepad
impl ReferenceType for Gamepad
[src]
impl ReferenceType for Gamepad
unsafe fn from_reference_unchecked(reference: Reference) -> Self
[src]
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! Read more
impl From<Gamepad> for Reference
[src]
impl From<Gamepad> for Reference
impl TryFrom<Gamepad> for Reference
[src]
impl TryFrom<Gamepad> for Reference
type Error = Void
The type returned in the event of a conversion error.
fn try_from(value: Gamepad) -> Result<Self, Self::Error>
[src]
fn try_from(value: Gamepad) -> Result<Self, Self::Error>
Performs the conversion.
impl TryFrom<Reference> for Gamepad
[src]
impl TryFrom<Reference> for Gamepad
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: Reference) -> Result<Self, Self::Error>
[src]
fn try_from(reference: Reference) -> Result<Self, Self::Error>
Performs the conversion.
impl<'_r> TryFrom<&'_r Reference> for Gamepad
[src]
impl<'_r> TryFrom<&'_r Reference> for Gamepad
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: &Reference) -> Result<Self, Self::Error>
[src]
fn try_from(reference: &Reference) -> Result<Self, Self::Error>
Performs the conversion.
impl TryFrom<Value> for Gamepad
[src]
impl TryFrom<Value> for Gamepad
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<Self, Self::Error>
[src]
fn try_from(value: Value) -> Result<Self, Self::Error>
Performs the conversion.
impl<'_r> TryFrom<&'_r Value> for Gamepad
[src]
impl<'_r> TryFrom<&'_r Value> for Gamepad
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<Self, Self::Error>
[src]
fn try_from(value: &Value) -> Result<Self, Self::Error>
Performs the conversion.
impl JsSerialize for Gamepad
[src]
impl JsSerialize for Gamepad