GamepadButtonEvent

Struct GamepadButtonEvent 

Source
pub struct GamepadButtonEvent { /* private fields */ }
Expand description

Event representing a change in gamepad button state (eg, pressing a button on a gamepad).

See Renderer::fire_gamepad_button_event.

Implementations§

Source§

impl GamepadButtonEvent

Source

pub fn new( lib: Arc<Library>, index: u32, button_index: u32, value: f64, ) -> Result<GamepadButtonEvent, CreationError>

Create a new GamepadButtonEvent.

§Arguments
  • lib - The ultralight library.
  • index - The index of the gamepad, this should match the value previously set in Renderer::set_gamepad_details.
  • button_index - The index of the button whose value has changed. This value should be in the range previously set in Renderer::set_gamepad_details.
  • value - The new value of the axis. This value should be normalized to the range [-1.0, 1.0]. with any value greater than 0.0 to be considered “pressed”.

Trait Implementations§

Source§

impl Drop for GamepadButtonEvent

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.