wolfrpg_map_parser/command/input_key_command/input_key/
mouse_target.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#[cfg(feature = "serde")]
use serde::Serialize;

#[cfg_attr(feature = "serde", derive(Serialize))]
pub enum MouseTarget {
    Click       = 0x00,
    XPos        = 0x01,
    YPos        = 0x02,
    WheelDelta  = 0x03,
    Unknown
}

impl MouseTarget {
    pub const fn new(option: u8) -> Self {
        match option {
            0x00 => MouseTarget::Click,
            0x01 => MouseTarget::XPos,
            0x02 => MouseTarget::YPos,
            0x03 => MouseTarget::WheelDelta,
            _ => MouseTarget::Unknown
        }
    }
}