Skip to content
Snippets Groups Projects
Commit c63c3a6a authored by Kalle Löfgren's avatar Kalle Löfgren
Browse files

Update Project_Mouse.rs

parent 6cb1a543
Branches
No related tags found
No related merge requests found
......@@ -304,16 +304,16 @@ const APP: () = {
let (x, y) = cx.resources.pmw3389.read_status().unwrap();
//rprintln!("{} {}", x as i64, y as i64);
POS_X += x as i64;
POS_Y += y as i64;
POS_X = x as f32;
POS_Y = y as f32;
let report = PMouseReport {
buttons: ((M1_click.is_high().unwrap() as u8) << 4
| (M2_click.is_high().unwrap() as u8) << 3
| (w_click.is_high().unwrap() as u8) << 2
| (r_click.is_high().unwrap() as u8) << 1
| (l_click.is_high().unwrap() as u8)),
x: (-x as i8)>>1,
y: (-y as i8)>>1,
x: ((-POS_X * *myScaler) as i8)>>1,
y: ((-POS_Y * *myScaler) as i8)>>1,
wheel: wheel_count,
};
hid.push_input(&report).ok();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment