Fixed mouse handling

This commit is contained in:
hodasemi 2023-02-21 11:47:47 +01:00
parent 26697fca1c
commit 53f4dc6928

View file

@ -90,26 +90,15 @@ fn main() -> ! {
} }
let mut delay = Delay::new(core.SYST, clocks.system_clock.freq().to_Hz()); let mut delay = Delay::new(core.SYST, clocks.system_clock.freq().to_Hz());
const PIXEL: i8 = 100; const PIXEL: i8 = 2;
const WAIT_TIME: u32 = 250; const WAIT_TIME: u32 = 10000;
loop { loop {
mouse_move(&mut delay, WAIT_TIME, PIXEL); mouse_move(&mut delay, WAIT_TIME, PIXEL);
mouse_move(&mut delay, WAIT_TIME, -PIXEL); mouse_move(&mut delay, 50, -PIXEL);
} }
} }
#[allow(unused)]
fn reworked_mouse_descriptor() -> &'static [u8] {
&[
5, 1, 9, 2, 161, 1, 9, 1, 161, 0, 5, 9, 25, 1, 41, 8, 21, 0, 37, 1, 117, 1, 149, 8,
// add usage vendor here manually
9, 2, // Input starts here
129, 2, 5, 1, 9, 48, 23, 129, 255, 255, 255, 37, 127, 117, 8, 149, 1, 129, 6, 9, 49, 129,
6, 9, 56, 129, 6, 5, 12, 10, 56, 2, 129, 6, 192, 192,
]
}
fn mouse_move(delay: &mut Delay, wait_time: u32, v: i8) { fn mouse_move(delay: &mut Delay, wait_time: u32, v: i8) {
delay.delay_ms(wait_time); delay.delay_ms(wait_time);