Skip to main content

steam_enums/
einputmode.rs

1#![allow(non_camel_case_types)]
2#![allow(non_upper_case_globals)]
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
4#[repr(i32)]
5pub enum EInputMode {
6    Unknown = 0,
7    Mouse = 1,
8    Controller = 2,
9    MouseAndController = 3,
10}
11
12impl EInputMode {
13    pub fn from_i32(val: i32) -> Option<Self> {
14        match val {
15            x if x == Self::Unknown as i32 => Some(Self::Unknown),
16            x if x == Self::Mouse as i32 => Some(Self::Mouse),
17            x if x == Self::Controller as i32 => Some(Self::Controller),
18            x if x == Self::MouseAndController as i32 => Some(Self::MouseAndController),
19            _ => None,
20        }
21    }
22}