Francis Beland
New Member
Hello,
One of the thing I really like about the SP3 is the pen integration that is really well done. There is almost no lag and it's very precise. Unfortunately, even with the palm rejection, I had some problems when putting my hand before approaching the pen.
So I decided I needed a quick way to disable the touch screen when I was using Onenote with the pen. I did a little search and here is the way I did it.
To disable the touch screen, you need to go in Device Manager and disable the HID-compliant touch screen under Human Interface Devices. The pen and keyboard will still be usable. Since I wanted the process to be shorter, I decided to write a Powershell script tu automate both tasks of disabling and enable the touch screen.
Powershell
First of all, if you want to run a script in ps1 format (which is Powershell script file extension), you need to change the way Powershell run script by using the set-execution policy. To do it, open Powershell in admin mode (Right-Click Powershell and click run as administrator) and type the following code (only once):
To disable and enable devices in the device manager in Powershell, you need to download the Device Management PowerShell Cmdlets module available here: https://gallery.technet.microsoft.com/scriptcenter/Device-Management-7fad2388 . Once downloaded, unzip it to any folder but take note of the exact path since you'll need it in the script.
Once done, you can start the Script. The script is quite simple:
The "path" is the path of the file you unzipped earlier.
To create the enable device script, use the same code but at the end, put enable-device.
**EDIT** Windows Language modification
Please note that if you're using Windows in another language, you will have to change the "HID-compliant touch screen" in the script with what it's called in your language. Please send me a PM your language specific device name and I will add it here.
English: "HID-compliant touch screen"
Français: "Écran tactile HID"
UAC
As you probably know, UAC is the little popup you receive when you try to do something that require elevated privileges. Disabling and Enabling devices are things that need elevated privileges to do. If you disabled UAC, please disregard this part but I wanted to keep it.
When you run a Powershell script, it won't ask you to elevate into admin mode but it only gives you an error. You need to elevate your privileges inside the Powershell script. I found this script there : http://blogs.msdn.com/b/virtual_pc_guy/archive/2010/09/23/a-self-elevating-powershell-script.aspx
You just need to copy the code and paste it at the start of your script to get the UAC popup when running it.
From now on, you can right-click on the ps1 script and click "Run with Powershell". However, if you double-click on a ps1 file, it open Notepad to edit it. Since I wanted a fastest way to open it, I created a batch file to call Powershell and run the ps1 script.
Batch File
Here is the code of my batch file which is quite simple:
I then save it as a .bat file.
Pin it to start menu
When you right-click a bat file, you don't have the option of "Pin it to start". To make it available in the MetroUI menu, you need to copy the shortcuts of both batch files (disable.bat and enable.bat) to the following path: C:\Users\user\AppData\Roaming\Microsoft\Windows\Start Menu
You can now open you MetroUI, Swipe down the the Apps by name and you will see both shortcuts. You can now right-click on them and select "Pin to Start".
Please note that when the touch screen is disabled, the pen, the keyboard (including touchpad) and the Home button on the tablet are still active and can be used. I hope it can help some people if they have the same problem.
One of the thing I really like about the SP3 is the pen integration that is really well done. There is almost no lag and it's very precise. Unfortunately, even with the palm rejection, I had some problems when putting my hand before approaching the pen.
So I decided I needed a quick way to disable the touch screen when I was using Onenote with the pen. I did a little search and here is the way I did it.
To disable the touch screen, you need to go in Device Manager and disable the HID-compliant touch screen under Human Interface Devices. The pen and keyboard will still be usable. Since I wanted the process to be shorter, I decided to write a Powershell script tu automate both tasks of disabling and enable the touch screen.
Powershell
First of all, if you want to run a script in ps1 format (which is Powershell script file extension), you need to change the way Powershell run script by using the set-execution policy. To do it, open Powershell in admin mode (Right-Click Powershell and click run as administrator) and type the following code (only once):
Code:
Set-ExecutionPolicy RemoteSigned
To disable and enable devices in the device manager in Powershell, you need to download the Device Management PowerShell Cmdlets module available here: https://gallery.technet.microsoft.com/scriptcenter/Device-Management-7fad2388 . Once downloaded, unzip it to any folder but take note of the exact path since you'll need it in the script.
Once done, you can start the Script. The script is quite simple:
Code:
$devicemgmtmodule = "c:\path\DeviceManagement.psd1"
import-module $devicemgmtmodule
get-device | where-object -property name -eq "HID-compliant touch screen" | disable-device
The "path" is the path of the file you unzipped earlier.
To create the enable device script, use the same code but at the end, put enable-device.
**EDIT** Windows Language modification
Please note that if you're using Windows in another language, you will have to change the "HID-compliant touch screen" in the script with what it's called in your language. Please send me a PM your language specific device name and I will add it here.
English: "HID-compliant touch screen"
Français: "Écran tactile HID"
UAC
As you probably know, UAC is the little popup you receive when you try to do something that require elevated privileges. Disabling and Enabling devices are things that need elevated privileges to do. If you disabled UAC, please disregard this part but I wanted to keep it.
When you run a Powershell script, it won't ask you to elevate into admin mode but it only gives you an error. You need to elevate your privileges inside the Powershell script. I found this script there : http://blogs.msdn.com/b/virtual_pc_guy/archive/2010/09/23/a-self-elevating-powershell-script.aspx
You just need to copy the code and paste it at the start of your script to get the UAC popup when running it.
From now on, you can right-click on the ps1 script and click "Run with Powershell". However, if you double-click on a ps1 file, it open Notepad to edit it. Since I wanted a fastest way to open it, I created a batch file to call Powershell and run the ps1 script.
Batch File
Here is the code of my batch file which is quite simple:
Code:
powershell.exe -file C:\path\Disable_TouchScreen.ps1
Pin it to start menu
When you right-click a bat file, you don't have the option of "Pin it to start". To make it available in the MetroUI menu, you need to copy the shortcuts of both batch files (disable.bat and enable.bat) to the following path: C:\Users\user\AppData\Roaming\Microsoft\Windows\Start Menu
You can now open you MetroUI, Swipe down the the Apps by name and you will see both shortcuts. You can now right-click on them and select "Pin to Start".
Please note that when the touch screen is disabled, the pen, the keyboard (including touchpad) and the Home button on the tablet are still active and can be used. I hope it can help some people if they have the same problem.
Last edited: