[][src]Struct stdweb::web::Gamepad

pub struct Gamepad(_);

An individual gamepad/controller.

(JavaScript docs)

Methods

impl Gamepad[src]

pub fn id(&self) -> String[src]

A string containing some information about this gamepad.

(JavaScript docs)

pub fn index(&self) -> i32[src]

An auto-incrementing integer to uniquely identify a connected Gamepad.

(JavaScript docs)

pub fn connected(&self) -> bool[src]

Is this gamepad connected to the system, powered on, and usable?

(JavaScript docs)

pub fn timestamp(&self) -> f64[src]

Monotonically increasing time this gamepad was updated.

(JavaScript docs)

pub fn mapping(&self) -> GamepadMappingType[src]

The mapping in use for this device.

(JavaScript docs)

pub fn axes(&self) -> Vec<f64>[src]

Array of values for all axes of the gamepad.

(JavaScript docs)

pub fn buttons(&self) -> Vec<GamepadButton>[src]

Array of button states for all buttons of the gamepad.

(JavaScript docs)

pub fn get_all() -> Vec<Option<Gamepad>>[src]

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.

(JavaScript docs)

Trait Implementations

impl JsSerialize for Gamepad[src]

impl TryFrom<Gamepad> for Reference[src]

type Error = Void

The type returned in the event of a conversion error.

impl TryFrom<Reference> for Gamepad[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Reference> for Gamepad[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Value> for Gamepad[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Value> for Gamepad[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl InstanceOf for Gamepad[src]

impl ReferenceType for Gamepad[src]

impl From<Gamepad> for Reference[src]

impl Eq for Gamepad[src]

impl AsRef<Reference> for Gamepad[src]

impl PartialEq<Gamepad> for Gamepad[src]

impl Clone for Gamepad[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Gamepad[src]

Auto Trait Implementations

impl Send for Gamepad

impl Sync for Gamepad

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]