#[cfg(feature = "gamepad")]
#[derive(Default)]
pub struct Gamepad {
    pub gilrs: Option<gilrs::Gilrs>,
    pub gamepad: Option<gilrs::GamepadId>,
    pub events: Vec<gilrs::Event>,
    pub just_pressed_buttons: std::collections::HashSet<gilrs::Button>,
}

#[cfg(feature = "gamepad")]
impl Gamepad {
    pub fn just_pressed(&self, button: gilrs::Button) -> bool {
        self.just_pressed_buttons.contains(&button)
    }
}

#[cfg(not(feature = "gamepad"))]
#[derive(Default)]
pub struct Gamepad;
