Skip to main content

viiper_client/devices/mouse/
input.rs

1// This file is auto-generated by VIIPER codegen. DO NOT EDIT.
2
3use crate::wire::DeviceInput;
4
5#[derive(Debug, Clone, Default)]
6pub struct MouseInput {
7    pub buttons: u8,
8    pub dx: i16,
9    pub dy: i16,
10    pub wheel: i16,
11    pub pan: i16,
12}
13
14impl DeviceInput for MouseInput {
15    fn to_bytes(&self) -> Vec<u8> {
16        let mut buf = Vec::new();
17        buf.extend_from_slice(&self.buttons.to_le_bytes());
18        buf.extend_from_slice(&self.dx.to_le_bytes());
19        buf.extend_from_slice(&self.dy.to_le_bytes());
20        buf.extend_from_slice(&self.wheel.to_le_bytes());
21        buf.extend_from_slice(&self.pan.to_le_bytes());
22        buf
23    }
24}