1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use crate::prelude::*;

pub const MOUSE_RIGHTBUTTON: u16    = 1 << 1;
pub const MOUSE_LEFTBUTTON: u16     = 1 << 2;
pub const MOUSE_SIDEBUTTON: u16     = 1 << 3;

pub const MOUSE_DELTA_CENTER: u16   = 0x200;

#[repr(C)]
pub struct mouse_cond_t {
    pub buttons:    u16,
    pub dummy1:     u16,
    pub dx:         i16,
    pub dy:         i16,
    pub dz:         i16,
    pub dummy2:     u16,
    pub dummy3:     u32,
    pub dummy4:     u32,
}

#[repr(C)]
pub struct mouse_state_t {
    pub buttons:    u32,
    pub dx:         c_int,
    pub dy:         c_int,
    pub dz:         c_int,
}

extern "C" {
    pub fn mouse_init();
    pub fn mouse_shutdown();
}