By monitoring the registry I found what changes are made in the registry when that feature was switch on/off using Win Settings. However, if the registr is changed manually, or using AHK (see below) it does not work immediately. I need to reboot the machine to make it work, contrary to what happens by using the win settings, which result is instantaneous.
Is there a way to correct the code below, so to make it work, so "to refresh" the registry without "rebooting" the machine? Or more specifically (in my case), is it possible to disable "drag two fingers to scroll" (or any other Win Setting) using AHK?
Code: Select all
SetTitleMatchMode, 2 ; Set title matching to "contains"
#Persistent ; Keep the script running
Loop {
WinGetActiveTitle, ActiveTitle
IfInString, ActiveTitle, MyApp {
; Disable touchpad scrolling by modifying the registry
RegWrite, REG_DWORD, HKCU, SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad, PanEnabled, 0 ; Set to 0 to disable scrolling
} Else {
; Enable touchpad scrolling by modifying the registry
RegWrite, REG_DWORD, HKCU, SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad, PanEnabled, 1 ; Set to 1 to enable scrolling
}
Sleep, 1000 ; Check every second