We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7267f46 commit 62a882cCopy full SHA for 62a882c
framework_lib/src/touchscreen.rs
@@ -130,6 +130,11 @@ pub trait TouchScreen {
130
131
Some(())
132
}
133
+
134
+ fn enable_touch(&self, enable: bool) -> Option<()> {
135
+ self.send_message(0x38, 0, vec![0, !enable as u8])?;
136
+ Some(())
137
+ }
138
139
140
pub fn print_touchscreen_fw_ver() -> Option<()> {
@@ -140,3 +145,12 @@ pub fn print_touchscreen_fw_ver() -> Option<()> {
145
141
146
device.check_fw_version()
142
147
148
149
+pub fn enable_touch(enable: bool) -> Option<()> {
150
+ #[cfg(target_os = "windows")]
151
+ let device = touchscreen_win::NativeWinTouchScreen::open_device()?;
152
+ #[cfg(not(target_os = "windows"))]
153
+ let device = HidapiTouchScreen::open_device()?;
154
155
+ device.enable_touch(enable)
156
+}
0 commit comments