Skip to content

Instantly share code, notes, and snippets.

@josheinstein
Last active September 21, 2015 16:20
Show Gist options
  • Save josheinstein/1deedcb008396e533172 to your computer and use it in GitHub Desktop.
Save josheinstein/1deedcb008396e533172 to your computer and use it in GitHub Desktop.
Disable Surface Touch Screen with Pen Button - At startup, ensures that the touch screen is enabled. When the Surface pen button is double clicked (sends F19 key) the script toggles the touch screen on and off. On exit, touch screen is re-enabled. In order to avoid UAC prompts on devmanview, this should be started with elevated permissions.
#NoEnv
#SingleInstance, Ignore
SendMode Input
SetWorkingDir C:\Users\jeinstein\Dropbox\Tools\DevManView\x64
OnExit, Cleanup
IsTouchEnabled = 1
Run, DevManView.exe /enable "HID-compliant touch screen"
#F19::
if (IsTouchEnabled = 1) {
Run, DevManView.exe /disable "HID-compliant touch screen"
IsTouchEnabled = 0
TrayTip, Touch Disabled, Double-click the top pen button to re-enable., 5, 17
}
else {
Run, DevManView.exe /enable "HID-compliant touch screen"
IsTouchEnabled = 1
TrayTip, Touch Enabled, Double-click the top pen button to disable., 5, 17
}
Return
Cleanup:
Run, DevManView.exe /enable "HID-compliant touch screen"
IsTouchEnabled = 1
Return
@josheinstein
Copy link
Author

Devmanview.exe can be downloaded here: http://www.nirsoft.net/utils/device_manager_view.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment