wolfrpg_map_parser/command/input_key_command/input_toggle/
device_inputs.rs1#[cfg(feature = "serde")]
2use serde::{Serialize, Deserialize};
3
4#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5#[derive(PartialEq, Clone)]
6pub enum DeviceInputs {
7 KeyboardKey = 0x00,
8 AllMouseInput = 0x01,
9 AllPadInput = 0x02,
10 AllDevices = 0x03,
11 Unknown
12}
13
14impl DeviceInputs {
15 pub const fn new(inputs: u8) -> Self {
16 match inputs {
17 0x00 => DeviceInputs::KeyboardKey,
18 0x01 => DeviceInputs::AllMouseInput,
19 0x02 => DeviceInputs::AllPadInput,
20 0x03 => DeviceInputs::AllDevices,
21 _ => DeviceInputs::Unknown
22 }
23 }
24}