#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum EControllerElementType {
    None = -1,
    Thumb = 0,
    ButtonSteam = 1,
    JoystickLeft = 2,
    ButtonJoystickLeft = 3,
    JoystickRight = 4,
    ButtonJoystickRight = 5,
    DPad = 6,
    ButtonA = 7,
    ButtonB = 8,
    ButtonX = 9,
    ButtonY = 10,
    ButtonSelect = 11,
    ButtonStart = 12,
    ButtonTriggerLeft = 13,
    ButtonTriggerRight = 14,
    ButtonBumperLeft = 15,
    ButtonBumperRight = 16,
    ButtonMacro0 = 17,
    ButtonMacro1 = 18,
    ButtonMacro2 = 19,
    ButtonMacro3 = 20,
    ButtonMacro4 = 21,
    ButtonMacro5 = 22,
    ButtonMacro6 = 23,
    ButtonMacro7 = 24,
    TrackpadCenter = 25,
    TrackpadLeft = 26,
    TrackpadRight = 27,
    Keyboard = 28,
    MagnifyingGlass = 29,
    ButtonMacro1Finger = 30,
    ButtonMacro2Finger = 31,
    RecordInput = 32,
    PlaybackInput = 33,
    Paste = 34,
    Max = 35,
}

impl EControllerElementType {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::None as i32 => Some(Self::None),
            x if x == Self::Thumb as i32 => Some(Self::Thumb),
            x if x == Self::ButtonSteam as i32 => Some(Self::ButtonSteam),
            x if x == Self::JoystickLeft as i32 => Some(Self::JoystickLeft),
            x if x == Self::ButtonJoystickLeft as i32 => Some(Self::ButtonJoystickLeft),
            x if x == Self::JoystickRight as i32 => Some(Self::JoystickRight),
            x if x == Self::ButtonJoystickRight as i32 => Some(Self::ButtonJoystickRight),
            x if x == Self::DPad as i32 => Some(Self::DPad),
            x if x == Self::ButtonA as i32 => Some(Self::ButtonA),
            x if x == Self::ButtonB as i32 => Some(Self::ButtonB),
            x if x == Self::ButtonX as i32 => Some(Self::ButtonX),
            x if x == Self::ButtonY as i32 => Some(Self::ButtonY),
            x if x == Self::ButtonSelect as i32 => Some(Self::ButtonSelect),
            x if x == Self::ButtonStart as i32 => Some(Self::ButtonStart),
            x if x == Self::ButtonTriggerLeft as i32 => Some(Self::ButtonTriggerLeft),
            x if x == Self::ButtonTriggerRight as i32 => Some(Self::ButtonTriggerRight),
            x if x == Self::ButtonBumperLeft as i32 => Some(Self::ButtonBumperLeft),
            x if x == Self::ButtonBumperRight as i32 => Some(Self::ButtonBumperRight),
            x if x == Self::ButtonMacro0 as i32 => Some(Self::ButtonMacro0),
            x if x == Self::ButtonMacro1 as i32 => Some(Self::ButtonMacro1),
            x if x == Self::ButtonMacro2 as i32 => Some(Self::ButtonMacro2),
            x if x == Self::ButtonMacro3 as i32 => Some(Self::ButtonMacro3),
            x if x == Self::ButtonMacro4 as i32 => Some(Self::ButtonMacro4),
            x if x == Self::ButtonMacro5 as i32 => Some(Self::ButtonMacro5),
            x if x == Self::ButtonMacro6 as i32 => Some(Self::ButtonMacro6),
            x if x == Self::ButtonMacro7 as i32 => Some(Self::ButtonMacro7),
            x if x == Self::TrackpadCenter as i32 => Some(Self::TrackpadCenter),
            x if x == Self::TrackpadLeft as i32 => Some(Self::TrackpadLeft),
            x if x == Self::TrackpadRight as i32 => Some(Self::TrackpadRight),
            x if x == Self::Keyboard as i32 => Some(Self::Keyboard),
            x if x == Self::MagnifyingGlass as i32 => Some(Self::MagnifyingGlass),
            x if x == Self::ButtonMacro1Finger as i32 => Some(Self::ButtonMacro1Finger),
            x if x == Self::ButtonMacro2Finger as i32 => Some(Self::ButtonMacro2Finger),
            x if x == Self::RecordInput as i32 => Some(Self::RecordInput),
            x if x == Self::PlaybackInput as i32 => Some(Self::PlaybackInput),
            x if x == Self::Paste as i32 => Some(Self::Paste),
            x if x == Self::Max as i32 => Some(Self::Max),
            _ => None,
        }
    }
}
