I have had this problem with my GPD Pocket 3 laptop for a year now where anytime I am typing, which I do a fair amount of, every few minutes, one of my finger inadvertently and unwittingly touches the trackpad, which selects the document I am typing in a different spot and I don't notice for a few seconds that it's typing in a different spot. Then I have to find where it has been typing and select just that text that was relocated from the middle of other words that make no sense now, and make sure I get out of it and make sure that what I am selecting matches what I was trying to say and what I had already typed in the part of the document that I was intending to type it. This is a thing that always takes at least a minute to fix and it happens real frequently.
This has annoyed me so much that I tried to find a way to turn the trackpad on or off but the GPD Pocket 3 has a sort of custom layout for the outermost keys like the Function keys which share functionality with the number keys, the shift keys, there's only one command key, the tab, caps lock and both shift keys are smaller and the right shift key is especially small, the up and down arrow keys are half the size of the left and right arrow keys, and the function keys and number keys at the top of the keyboard are all half sized keys. Some buttons are missing altogether. And there are common laptop keys that are missing from this layout. There's a display on/off key and a trackpad on/off key on many laptops, which I do not have.
So I tried the next nest thing and looked in settings for these options to turn it on or off. But because this is a niche product and some changes had to be made to the common settings in order to get the tablet touch screen this laptop uses to work like a windows laptop screen with a little forward facing camera built in to be used as a webcam, even though it cannot be used with Windows Hello to unlock my laptop, this has caused that the trackpad is actually treated like a regular HID-compliant mouse. So there's no way to turn the trackpad off through settings because of that.
I eventually found that I could turn the trackpad off through Device Manager, but it was labelled as an HID-compliant mouse. So I turned it off and the typing problem has stopped but there is now the rare occasion that I could use a mouse and don't have one. So I have to use the touch screen to do things, which can be a little complicated.
So I realized that scripts are very useful for things like this. I already use scripts to manage certain things on my server which I need done regularly, so I looked up if I could use a batch script to turn devices on or off in Device Manager. The answer that I found was yes.
So here we go. Since I have no clue what I am doing I did some research and found some stuff that says I need to do this:
"@echo off
set /p choice="Enter 'enable' to enable the trackpad or 'disable' to disable it: "
if /i "%choice%"=="enable" (
powershell -Command "Get-PnpDevice -FriendlyName '*trackpad*' | Enable-PnpDevice -Confirm:$false"
echo Trackpad has been enabled.
) else if /i "%choice%"=="disable" (
powershell -Command "Get-PnpDevice -FriendlyName '*trackpad*' | Disable-PnpDevice -Confirm:$false"
echo Trackpad has been disabled.
) else (
echo Invalid choice. Please enter 'enable' or 'disable'.
)
pause"
I have no idea if this is going to work and I thought it prudent to check stuff beforehand because where I found these parts, I can't actually be sure that they work the way I want to. For all I know I just grabbed a command that turns off a crucial process in the Registry like the display so nothing will display anymore and I have to reinstall windows or something.
I had asked Doug, my instructor about this and intended that he tell me what he thought before I proceeded incase I was doing something I didn't want to do. After all, I use this laptop for everything, more than I use my desktop at home now.
He came up with the idea to write a PowerShell script that would search whether the device was enabled or disabled, and would use an "if" statement in the code of the script to have it respond accordingly: if enabled, disable it, if disabled, enable it. So he then went to the Microsoft documentation the command "Get-PnpDevice" and all of the flags he would need to use with it to make it work.
So then he wrote this:
if ((Get-PnpDevice -InstanceId "HID\VID_258A&PID_000C&MI_01&COL01\7&23463051&0&0000").Status -eq "OK")
{
Get-PnpDevice -InstanceId "HID\VID_258A&PID_000C&MI_01&COL01\7&23463051&0&0000" | Disable-PnpDevice -Confirm:$false
}
else
{
Get-PnpDevice -InstanceId "HID\VID_258A&PID_000C&MI_01&COL01\7&23463051&0&0000" | Enable-PnpDevice -Confirm:$false
}
He had me open PowerShell ISE and paste this code which he emailed me. And unfortunately while he was troubleshooting how to get it wo work because there were a few hurtles, I had to go to a SCRUM meeting and discuss what I was working on and what research assignment we should do over the weekend with a bunch of classmates and listen to what they were doing.
So when I got back he had already solved everything. But he told me what he did. PowerShell ISE stands for Integrated Scripting Environment, which is basically an IDE for PowerShell. IDE stands for Integrated Development Environment. It has features to make writing, testing and debugging easier.
Status Class FriendlyName InstanceId
------ ----- ------------ ----------
Unknown HIDClass USB Optical Mouse USB\VID_046D...
Unknown Mouse HID-compliant mouse HID\VID_222A...
OK Mouse Logitech HID-compliant Unifying Mouse HID\VID_046D...
Error Mouse HID-compliant mouse HID\VID_258A...
OK Mouse Logitech HID-compliant Unifying Mouse HID\VID_046D...
OK Mouse HID-compliant mouse HID\VID_046D...
Unknown Mouse HID-compliant Optical Mouse HID\VID_046D...
OK Mouse Logitech HID-compliant Unifying Mouse HID\VID_046D...
OK Mouse Logitech HID-compliant Unifying Mouse HID\VID_046D...
Unknown Mouse Logitech HID-compliant Cordless Mouse HID\VID_046D...
So the device with the error status is the trackpad that has already been disabled. So that makes it easy to find. However, every single one of these devices has an individual Instance ID. So Doug ran the command "(Get-PnpDevice -FriendlyName "*Mouse*" -Status ERROR).InstanceId". Putting parenthesis around the initial command to check the status of the device tells the shell to treat the whole thing like an object, so that he can then ask it at the end to tell him the Instance ID. It gave us the full ID. The Instance ID is the part of the whole script inserted earlier that starts with HID/VID.
Next hurtle. There's an annoying problem with PowerShell scripts. You can't just double-click on the script to make it run. If you double-click any normal batch script for instance, it simply runs. However, with a PS1 (PowerShell script), it simply opens the code for the script in notepad--just in case you wanted to look at it for some reason. Nice, real helpful! So he moved the icon to my documents folder I think, and then created a shortcut from that on the desktop. The nice thing about shortcuts, is that they always activate the script, even if it is a PowerShell Script.
Next hurtle, when the script is activated, it will then open a big, annoying window, and it will just sit there until the script finishes running. This can be a bit annoying and get in the way. The nice thing about shortcuts however, is that if you go Properties tab>Run dropdown menu (halfway down the window), which lets you run it minimized, maximized or windowed, you can select minimized and then it will not get in the way and be annoying.
Next Hurtle! Anytime you want to run a script to make a change in Device Manager, yo need admin privileges. But you cannot set the script to run PowerShell in administrator mode. However, you can for a shortcut! So, go Advanced button>Run as Administrator. Refer to the Image above for this as well!
The only thing that I have to put up with is that every time I activate the script, it will ask me if I am sure I want to do this. But I don't want to rely on my touchscreen for this, I just feel like that could be a bad idea just to get this script working. However, I can toggle between yes and no with the arrow keys on the keyboard. So I am fine with that.
This has been Truncat3d 00000000111100010100110______________end of line