Here is a solution that uses the free
AutoHotkey.
The following example script will loop, checking the registry key for the
mode every second, and will set the DPI accordingly.
As I'm not using a tablet, I couldn't fully test the script.
It uses the open-source project of
SetDPI.
You should download the utility from the Release page.
In my test script, this is located in C:\Temp\SetDpi.exe
.
I also assume that this refers to your primary monitor, which is the
first monitor, so numbered 1
.
#Persistent
lastmode = -1
SetTimer, checkmode, 1000
return
checkmode:
RegRead, mode, HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ImmersiveShell, TabletMode
if mode = lastmode
return
if mode = 0
Run, C:\Temp\SetDpi.exe 1 200, , Hide ; desktop mode
else
Run, C:\Temp\SetDpi.exe 1 225, , Hide ; tablet mode
lastmode = mode
return
If instead of a loop, you prefer using hotkeys to change the DPI,
use the following simplified script, where
F11 sets the DPI to 200 and F12 to 225:
F11::Run, C:\Temp\SetDpi.exe 1 200, , Hide
F12::Run, C:\Temp\SetDpi.exe 1 225, , Hide
After installing AutoHotKey, put the above text in a .ahk
file and
double-click it to test. You may stop the script by right-click on
the green H icon in the traybar and choosing Exit. To have it run on login,
place it in the Startup group at
C:\Users\USER-NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
.
Useful AutoHotkey documentation: