Skip to main content

steam_enums/
estreammousebutton.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 EStreamMouseButton {
6    Left = 1,
7    Right = 2,
8    Middle = 16,
9    X1 = 32,
10    X2 = 64,
11    Unknown = 4096,
12}
13
14impl EStreamMouseButton {
15    pub fn from_i32(val: i32) -> Option<Self> {
16        match val {
17            x if x == Self::Left as i32 => Some(Self::Left),
18            x if x == Self::Right as i32 => Some(Self::Right),
19            x if x == Self::Middle as i32 => Some(Self::Middle),
20            x if x == Self::X1 as i32 => Some(Self::X1),
21            x if x == Self::X2 as i32 => Some(Self::X2),
22            x if x == Self::Unknown as i32 => Some(Self::Unknown),
23            _ => None,
24        }
25    }
26}