lighthouse_protocol/input/
gamepad_button_event.rs

1use serde::{Deserialize, Serialize};
2
3/// A button event on a gamepad.
4#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
5#[serde(tag = "control", rename_all = "camelCase")]
6pub struct GamepadButtonEvent {
7    /// The button index.
8    pub index: usize,
9    /// Whether the button is pressed.
10    pub down: bool,
11    /// The value of the button (between 0.0 and 1.0, modeled after the Web Gamepad API).
12    pub value: f64,
13}