viiper-client 0.4.1

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 KeyboardInput {
    pub modifiers: u8,
    pub count: u8,
    pub keys: Vec<u8>,
}

impl DeviceInput for KeyboardInput {
    fn to_bytes(&self) -> Vec<u8> {
        let mut buf = Vec::new();
        buf.extend_from_slice(&self.modifiers.to_le_bytes());
        buf.extend_from_slice(&self.count.to_le_bytes());

        for item in &self.keys {
            buf.extend_from_slice(&item.to_le_bytes());
        }
        buf
    }
}