iron_remote_desktop/
input.rs

1use wasm_bindgen::prelude::*;
2
3#[wasm_bindgen]
4pub enum RotationUnit {
5    Pixel,
6    Line,
7    Page,
8}
9
10pub trait DeviceEvent {
11    fn mouse_button_pressed(button: u8) -> Self;
12
13    fn mouse_button_released(button: u8) -> Self;
14
15    fn mouse_move(x: u16, y: u16) -> Self;
16
17    fn wheel_rotations(vertical: bool, rotation_amount: i16, rotation_unit: RotationUnit) -> Self;
18
19    fn key_pressed(scancode: u16) -> Self;
20
21    fn key_released(scancode: u16) -> Self;
22
23    fn unicode_pressed(unicode: char) -> Self;
24
25    fn unicode_released(unicode: char) -> Self;
26}
27
28pub trait InputTransaction {
29    type DeviceEvent: DeviceEvent;
30
31    fn create() -> Self;
32
33    fn add_event(&mut self, event: Self::DeviceEvent);
34}