Struct stdweb::web::GamepadButton [−][src]
pub struct GamepadButton(_);
The state of an individual button on a gamepad device.
Methods
impl GamepadButton
[src]
impl GamepadButton
pub fn pressed(&self) -> bool
[src]
pub fn pressed(&self) -> bool
Is the button currently pressed?
pub fn touched(&self) -> bool
[src]
pub fn touched(&self) -> bool
Is the button currently touched?
MDN does not document this. Firefox supports it, but Chrome (as of v65) does not.
pub fn value(&self) -> f64
[src]
pub fn value(&self) -> f64
The amount which the button has been pressed, between 0.0 (not pressed), and 1.0 (fully pressed).
Trait Implementations
impl Clone for GamepadButton
[src]
impl Clone for GamepadButton
fn clone(&self) -> GamepadButton
[src]
fn clone(&self) -> GamepadButton
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 GamepadButton
[src]
impl Debug for GamepadButton
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 GamepadButton
[src]
impl Eq for GamepadButton
impl PartialEq for GamepadButton
[src]
impl PartialEq for GamepadButton
fn eq(&self, other: &GamepadButton) -> bool
[src]
fn eq(&self, other: &GamepadButton) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &GamepadButton) -> bool
[src]
fn ne(&self, other: &GamepadButton) -> bool
This method tests for !=
.
impl InstanceOf for GamepadButton
[src]
impl InstanceOf for GamepadButton
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 GamepadButton
[src]
impl AsRef<Reference> for GamepadButton
impl ReferenceType for GamepadButton
[src]
impl ReferenceType for GamepadButton
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<GamepadButton> for Reference
[src]
impl From<GamepadButton> for Reference
fn from(value: GamepadButton) -> Self
[src]
fn from(value: GamepadButton) -> Self
Performs the conversion.
impl TryFrom<GamepadButton> for Reference
[src]
impl TryFrom<GamepadButton> for Reference
type Error = Void
The type returned in the event of a conversion error.
fn try_from(value: GamepadButton) -> Result<Self, Self::Error>
[src]
fn try_from(value: GamepadButton) -> Result<Self, Self::Error>
Performs the conversion.
impl TryFrom<Reference> for GamepadButton
[src]
impl TryFrom<Reference> for GamepadButton
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 GamepadButton
[src]
impl<'_r> TryFrom<&'_r Reference> for GamepadButton
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 GamepadButton
[src]
impl TryFrom<Value> for GamepadButton
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 GamepadButton
[src]
impl<'_r> TryFrom<&'_r Value> for GamepadButton
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 GamepadButton
[src]
impl JsSerialize for GamepadButton
Auto Trait Implementations
impl Send for GamepadButton
impl Send for GamepadButton
impl Sync for GamepadButton
impl Sync for GamepadButton