viiper-client 0.7.0

VIIPER Client Library for Rust
Documentation
// This file is auto-generated by VIIPER codegen. DO NOT EDIT.

use crate::wire::DeviceInput;

#[derive(Debug, Clone, Default)]
pub struct MouseInput {
    pub buttons: u8,
    pub dx: i16,
    pub dy: i16,
    pub wheel: i16,
    pub pan: i16,
}

impl DeviceInput for MouseInput {
    fn to_bytes(&self) -> Vec<u8> {
        let mut buf = Vec::new();
        buf.extend_from_slice(&self.buttons.to_le_bytes());
        buf.extend_from_slice(&self.dx.to_le_bytes());
        buf.extend_from_slice(&self.dy.to_le_bytes());
        buf.extend_from_slice(&self.wheel.to_le_bytes());
        buf.extend_from_slice(&self.pan.to_le_bytes());
        buf
    }
}