Struct stdweb::web::Gamepad [−][src]
pub struct Gamepad(_);
An individual gamepad/controller.
Methods
impl Gamepad[src]
impl Gamepadpub fn id(&self) -> String[src]
pub fn id(&self) -> StringA string containing some information about this gamepad.
pub fn index(&self) -> i32[src]
pub fn index(&self) -> i32An auto-incrementing integer to uniquely identify a connected Gamepad.
pub fn connected(&self) -> bool[src]
pub fn connected(&self) -> boolIs this gamepad connected to the system, powered on, and usable?
pub fn timestamp(&self) -> f64[src]
pub fn timestamp(&self) -> f64Monotonically increasing time this gamepad was updated.
pub fn mapping(&self) -> GamepadMappingType[src]
pub fn mapping(&self) -> GamepadMappingTypeThe 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 Gamepadfn clone(&self) -> Gamepad[src]
fn clone(&self) -> GamepadReturns 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 Gamepadfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Eq for Gamepad[src]
impl Eq for Gamepadimpl PartialEq for Gamepad[src]
impl PartialEq for Gamepadfn eq(&self, other: &Gamepad) -> bool[src]
fn eq(&self, other: &Gamepad) -> boolThis 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) -> boolThis method tests for !=.
impl InstanceOf for Gamepad[src]
impl InstanceOf for Gamepadfn instance_of(reference: &Reference) -> bool[src]
fn instance_of(reference: &Reference) -> boolChecks whenever a given Reference if of type Self.
impl AsRef<Reference> for Gamepad[src]
impl AsRef<Reference> for Gamepadimpl ReferenceType for Gamepad[src]
impl ReferenceType for Gamepadunsafe fn from_reference_unchecked(reference: Reference) -> Self[src]
unsafe fn from_reference_unchecked(reference: Reference) -> SelfConverts 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 Referenceimpl TryFrom<Gamepad> for Reference[src]
impl TryFrom<Gamepad> for Referencetype 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 Gamepadtype 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 Gamepadtype 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 Gamepadtype 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 Gamepadtype 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