File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ fn main() -> ! {
9292 ( 0 ..DEBOUNCE_BUFFER_SIZE ) . for_each ( |_| {
9393 let _ = state_buffer. push ( 0 ) ;
9494 } ) ;
95+ let mut prev_mouse_button = 0 ;
9596
9697 let keymap = Keymap :: default ( ) ;
9798 let empty_mouse_report = WheelMouseReport :: default ( ) ;
@@ -128,13 +129,15 @@ fn main() -> ! {
128129 }
129130 } ;
130131
131- if mouse_report != empty_mouse_report {
132+ if mouse_report != empty_mouse_report || mouse_report . buttons != prev_mouse_button {
132133 match egboard
133134 . interface :: < device:: mouse:: WheelMouseInterface < ' _ , _ > , _ > ( )
134135 . write_report ( & mouse_report)
135136 {
136137 Err ( UsbHidError :: WouldBlock ) => { }
137- Ok ( _) => { }
138+ Ok ( _) => {
139+ prev_mouse_button = mouse_report. buttons ;
140+ }
138141 Err ( e) => {
139142 core:: panic!( "Failed to write mouse report: {:?}" , e)
140143 }
You can’t perform that action at this time.
0 commit comments