API to change win10 touchpad 'Cursor speed' dynamically without restarting
-
We need to reduce touchpad cursor speed in certain state in our application. So, i was planning that when the application enter a specific state, we will change touchpad cursor speed at run time by using some Windows API. And when coming out of the specific state, revert the touchpad cursor speed to original value. However, i did not find any Windows API to change touchpad 'Cursor speed' dynamically without restarting. I found API to change mouse speed (SystemParametersInfo). But this API only changes the mouse cursor speed. It does not change touchpad cursor speed. I tried changing the below registry. But the problem with changing registry is that touchpad cursor speed gets updated only after system restart. I need an API to change touchpad cursor speed without restarting system (similar to how we can change mouse speed using SystemParametersInfo) HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad\CursorSpeed Any suggestions in this regard will be really very helpful.
-
We need to reduce touchpad cursor speed in certain state in our application. So, i was planning that when the application enter a specific state, we will change touchpad cursor speed at run time by using some Windows API. And when coming out of the specific state, revert the touchpad cursor speed to original value. However, i did not find any Windows API to change touchpad 'Cursor speed' dynamically without restarting. I found API to change mouse speed (SystemParametersInfo). But this API only changes the mouse cursor speed. It does not change touchpad cursor speed. I tried changing the below registry. But the problem with changing registry is that touchpad cursor speed gets updated only after system restart. I need an API to change touchpad cursor speed without restarting system (similar to how we can change mouse speed using SystemParametersInfo) HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad\CursorSpeed Any suggestions in this regard will be really very helpful.
-
We need to reduce touchpad cursor speed in certain state in our application. So, i was planning that when the application enter a specific state, we will change touchpad cursor speed at run time by using some Windows API. And when coming out of the specific state, revert the touchpad cursor speed to original value. However, i did not find any Windows API to change touchpad 'Cursor speed' dynamically without restarting. I found API to change mouse speed (SystemParametersInfo). But this API only changes the mouse cursor speed. It does not change touchpad cursor speed. I tried changing the below registry. But the problem with changing registry is that touchpad cursor speed gets updated only after system restart. I need an API to change touchpad cursor speed without restarting system (similar to how we can change mouse speed using SystemParametersInfo) HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad\CursorSpeed Any suggestions in this regard will be really very helpful.
Member 9453331 wrote:
I tried changing the below registry. But the problem with changing registry is that touchpad cursor speed gets updated only after system restart. I need an API to change touchpad cursor speed without restarting system (similar to how we can change mouse speed using SystemParametersInfo) HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad\CursorSpeed Any suggestions in this regard will be really very helpful.
If you need to restart the touchpad driver then you could probably use the [Setupapi](https://docs.microsoft.com/en-us/windows/desktop/devinst/setupapi-h). I believe that you will need to first call [SetupDiSetClassInstallParams](https://docs.microsoft.com/en-us/windows/desktop/api/setupapi/nf-setupapi-setupdisetclassinstallparamsw) with the SP_CLASSINSTALL_HEADER.InstallFunction set to [DIF_PROPERTYCHANGE](https://docs.microsoft.com/en-us/windows-hardware/drivers/install/dif-propertychange) followed by a call to the [SetupDiCallClassInstaller function](https://docs.microsoft.com/en-us/windows/desktop/api/setupapi/nf-setupapi-setupdicallclassinstaller) with the DI_FUNCTION also set to [DIF_PROPERTYCHANGE](https://docs.microsoft.com/en-us/windows-hardware/drivers/install/dif-propertychange). Be aware that many touchpad drivers are written by third-party vendor (i.e. not Microsoft). I don't think all touchpad drivers support being restarted from the Setup API. It really depends on how the third-party vendor has implemented their [driver co-installer](https://msdn.microsoft.com/en-us/library/windows/hardware/ff553394(v=vs.85).aspx). The Windows operating system is 'aware' of the co-installer capabilities from when the [co-installer was registered](https://docs.microsoft.com/en-us/windows/desktop/api/Setupapi/nf-setupapi-setupdiregistercodeviceinstallers). If you want to check if your touchpad supports enable/disable then go into the device manager and right click... if you see 'Disable Device' then that means that the co-installer supports device restart. Believe it or not the touchpad device driver itself probably supports [start/stop](https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/irp-mn-start-device) so there is nothing preventing you from developing a co-installer and registering it as the handler for the third-party touchpad driver as long as the co-installer DLL is not part of a [digitally-signed catalog](https://docs.microsoft.com/en-us/windows-hardware/drive