Created
February 2, 2023 14:22
-
-
Save imniko/0314e4d357a30b1bf84fe8e4fbf36703 to your computer and use it in GitHub Desktop.
Sample AHK script to change windows display scaling using https://github.com/imniko/SetDPI, compatible with AHK version 2.x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires AutoHotkey v2.0 | |
current_scale := 100 ; scale value you are currently in | |
next_scale := 125 ; scale value you want to switch to next | |
is_scaled := 0 | |
; Ctrl + Win + F1 toggles main monitor between 2 scale values | |
^#F1:: | |
{ | |
global is_scaled | |
global next_scale | |
global current_scale | |
if(is_scaled == 0) | |
{ | |
Run "SetDpi.exe " next_scale | |
} | |
else | |
{ | |
Run "SetDpi.exe " current_scale | |
} | |
is_scaled := !is_scaled | |
} | |
; Ctrl + Win + F2 sets 2nd monitor to a scale of 150 | |
^#F2:: | |
{ | |
Run "SetDpi.exe 150 2" | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment