pub struct GamepadButtonEvent { /* private fields */ }Expand description
Event representing a change in gamepad button state (eg, pressing a button on a gamepad).
Implementations§
Source§impl GamepadButtonEvent
impl GamepadButtonEvent
Sourcepub fn new(
lib: Arc<Library>,
index: u32,
button_index: u32,
value: f64,
) -> Result<GamepadButtonEvent, CreationError>
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 inRenderer::set_gamepad_details.button_index- The index of the button whose value has changed. This value should be in the range previously set inRenderer::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§
Auto Trait Implementations§
impl Freeze for GamepadButtonEvent
impl RefUnwindSafe for GamepadButtonEvent
impl !Send for GamepadButtonEvent
impl !Sync for GamepadButtonEvent
impl Unpin for GamepadButtonEvent
impl UnwindSafe for GamepadButtonEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more