Skip to content

Commit bb31f3e

Browse files
committed
touchscreen: Don't read if no reading requested
Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent f62df30 commit bb31f3e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

framework_lib/src/touchscreen_win.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ pub fn send_message(handle: &HANDLE, message_id: u8, read_len: usize, data: Vec<
8080
);
8181
debug!(" Success: {}", success);
8282

83+
if read_len == 0 {
84+
return Some(vec![]);
85+
}
86+
8387
let mut bytes_read = 0;
8488
debug!(" ReadFile");
8589
// HidD_GetFeature doesn't work, have to use ReadFile

0 commit comments

Comments
 (0)