Hotkey For Scaling In Windows 10?

Page 1 of 2 12 LastLast

  1. Posts : 32
    Windows 10
       #1

    Hotkey For Scaling In Windows 10?


    Is it possible to toggle a hotkey for switching between 100% and 125% scaling? I know how to accomplish this using Windows Settings, but I was hoping to perform it without entering the menu and adjusting the setting directly. If not natively within Windows, how about third-party software that could do it?
      My Computer


  2. Posts : 42,983
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2

    Hi, question has been asked before; no really satisfactory answer. E.g.
    Is it possible to have hotkeys to do display scaling?

    (OP didn't even reply).

    Hotkey for changing scaling level?
      My Computers


  3. Posts : 15,622
    19043.1237
       #3

    Hold down the ctrl key and use the mouse wheel up and down...
      My Computer


  4. Posts : 32
    Windows 10
    Thread Starter
       #4

    I could always create a keyboard macro to do it quickly using a program like AutoHotKey. I think I will try that since every solution I am finding to change scaling requires me to restart, re-login, or kill explorer.exe (which has unwanted side effects). At least a keyboard macro can be assigned to a hotkey and I won't have to mess with the registry. Thanks for confirming there wasn't an easy fix

    - - - Updated - - -

    I wrote a script that works perfectly for me using AutoHotKey. It is fast, accomplishing the change in about 1.5 to 2 seconds. I added comments all throughout the script to explain what it is doing. If you wish to use it follow the following instructions below:

    What Does It Do?
    When the user presses the Scroll Lock key:
    1. 1. It opens the Display Settings window
    2. 2. Reads HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\Your_Monitor_Entry_Folder\ to determine whether scaling is set to 100% or 125%.
    3. 3. Presses TAB three times to reach the drop down list for Scaling.
    4. 4. Based on what the current scaling value is, it will either press Up or Down to change the setting up by one increment.
    5. 5. It closes the Display Settings window.

    Install Instructions
    1. 1. Install AutoHotKey
    2. 2. Copy the script text into a text file and save it (i.e. DPI Scaling Toggle.txt).
    3. 3. Change the extension from .txt to .ahk
    4. 4. Make sure your current Scaling DPi is set to 100% or 125% in Display Settings.
    5. 5. Double-click DPI Scaling Toggle.ahk to start the script. It will stay running until you restart the system. The Scroll Lock key will toggle between 100% and 125%.
    6. 6. Setting the script to run at System Start is easy by creating a new STRING value in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run in the registry. The value should be set to the location of DPI Scaling Toggle.ahk on your system. For example: "C:\AutoHotKey Scripts\DPI Scaling Toggle.ahk".

    Customizing The Script
    Unfortunately you won't be able to simply copy and paste this script because the registry value it reads for your monitor will be unique to your monitor. You will need to open RegEdit, go to HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\ and copy the name of the folder that resides there. For my ASUS ProArt PA278QV the name of the folder there is AUS2701L9LMQS154928_26_07E4_78^BD9975B7A47E0467CAE6FE0D0FE09A4A. Copy the folder name for your monitor, and swap my monitor name on Line 19 with your own.

    You can change the key you wish to toggle on Line 10. If you aren't sure what value to use for the key you desire, you can check this List of Keys. In most cases you can simply swap ScrollLock for the exact key you wish to bind it to.

    You may wish to use Scaling other than 100% and 125%. Customizing it will involve changing how many times the Down and Up keys are pressed if you wish to change values more than one increment in either directly (i.e. between 100% and 200% or 125% and 175%). You will find those on Lines 17 and 22 respectively. It will also involve changing the value the registry is looking for on lines 15 and 20. If you would like any help please don't hesitate to ask.

    DPI Scaling Toggle Script
    Code:
    #Persistent ; Script continually runs
    #SingleInstance force ; If script is run a second time, it restart the instance already running
    
    DetectHiddenWindows, On
    ;Allows you to hide the CMD window. If you won't be hiding your CMD window, then no need to add this line.
    
    SetRegView 64
    ;Sets the registry view used by RegRead, allowing it in a 32-bit script to access the 64-bit registry view and vice versa.
    
    ScrollLock:: ; the toggle key
    RunWait, %ComSpec% /c  %windir%\System32\DpiScaling.exe ; launch Settings -> Display
    RegRead, CurrentDPI, HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\AUS2701L9LMQS154928_26_07E4_78^BD9975B7A47E0467CAE6FE0D0FE09A4A, DpiValue ; Determine the current scaling setting.
    
    Sleep, 750 ; Time to wait in milliseconds for the Display Settings window to appear
    if CurrentDPI = 0 ; Setting of 100%
    {
        Send, {Tab 3}{Down}!{F4} ; Tab key is pressed three times, then Down Arrow, and then close the Display Settings window
        Return
    }
    else if CurrentDPI = 1 ; Setting of 125%
    {
         Send, {Tab 3}{Up}!{F4} ; Tab key is pressed three times, then Up Arrow, and then close the Display Settings window
         Return
    }
    else
    {
        MsgBox, "Current Scaling DPI is neither 100`% nor 125`%. The current value is %CurrentDPI%."" ; 100% = 0, 125% = 1, 150% = 2, 175% = 3, 200% = 4, 225% = 6, and so on.
        Return
    }
      My Computer


  5. Posts : 42,983
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #5

    Yes, that's the only approach other than using a selection of preset fixed options.

    Just hope MS doesn't rearrange the GUI some time.
      My Computers


  6. Posts : 7
    Windows 11
       #6

    Mulsiphix said:
    I could always create a keyboard macro to do it quickly using a program like AutoHotKey. I think I will try that since every solution I am finding to change scaling requires me to restart, re-login, or kill explorer.exe (which has unwanted side effects). At least a keyboard macro can be assigned to a hotkey and I won't have to mess with the registry. Thanks for confirming there wasn't an easy fix

    - - - Updated - - -

    I wrote a script that works perfectly for me using AutoHotKey. It is fast, accomplishing the change in about 1.5 to 2 seconds. I added comments all throughout the script to explain what it is doing. If you wish to use it follow the following instructions below:

    What Does It Do?
    When the user presses the Scroll Lock key:
    1. 1. It opens the Display Settings window
    2. 2. Reads HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\Your_Monitor_Entry_Folder\ to determine whether scaling is set to 100% or 125%.
    3. 3. Presses TAB three times to reach the drop down list for Scaling.
    4. 4. Based on what the current scaling value is, it will either press Up or Down to change the setting up by one increment.
    5. 5. It closes the Display Settings window.

    Install Instructions
    1. 1. Install AutoHotKey
    2. 2. Copy the script text into a text file and save it (i.e. DPI Scaling Toggle.txt).
    3. 3. Change the extension from .txt to .ahk
    4. 4. Make sure your current Scaling DPi is set to 100% or 125% in Display Settings.
    5. 5. Double-click DPI Scaling Toggle.ahk to start the script. It will stay running until you restart the system. The Scroll Lock key will toggle between 100% and 125%.
    6. 6. Setting the script to run at System Start is easy by creating a new STRING value in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run in the registry. The value should be set to the location of DPI Scaling Toggle.ahk on your system. For example: "C:\AutoHotKey Scripts\DPI Scaling Toggle.ahk".

    Customizing The Script
    Unfortunately you won't be able to simply copy and paste this script because the registry value it reads for your monitor will be unique to your monitor. You will need to open RegEdit, go to HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\ and copy the name of the folder that resides there. For my ASUS ProArt PA278QV the name of the folder there is AUS2701L9LMQS154928_26_07E4_78^BD9975B7A47E0467CAE6FE0D0FE09A4A. Copy the folder name for your monitor, and swap my monitor name on Line 19 with your own.

    You can change the key you wish to toggle on Line 10. If you aren't sure what value to use for the key you desire, you can check this List of Keys. In most cases you can simply swap ScrollLock for the exact key you wish to bind it to.

    You may wish to use Scaling other than 100% and 125%. Customizing it will involve changing how many times the Down and Up keys are pressed if you wish to change values more than one increment in either directly (i.e. between 100% and 200% or 125% and 175%). You will find those on Lines 17 and 22 respectively. It will also involve changing the value the registry is looking for on lines 15 and 20. If you would like any help please don't hesitate to ask.

    DPI Scaling Toggle Script
    Code:
    #Persistent ; Script continually runs
    #SingleInstance force ; If script is run a second time, it restart the instance already running
    
    DetectHiddenWindows, On
    ;Allows you to hide the CMD window. If you won't be hiding your CMD window, then no need to add this line.
    
    SetRegView 64
    ;Sets the registry view used by RegRead, allowing it in a 32-bit script to access the 64-bit registry view and vice versa.
    
    ScrollLock:: ; the toggle key
    RunWait, %ComSpec% /c  %windir%\System32\DpiScaling.exe ; launch Settings -> Display
    RegRead, CurrentDPI, HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\AUS2701L9LMQS154928_26_07E4_78^BD9975B7A47E0467CAE6FE0D0FE09A4A, DpiValue ; Determine the current scaling setting.
    
    Sleep, 750 ; Time to wait in milliseconds for the Display Settings window to appear
    if CurrentDPI = 0 ; Setting of 100%
    {
        Send, {Tab 3}{Down}!{F4} ; Tab key is pressed three times, then Down Arrow, and then close the Display Settings window
        Return
    }
    else if CurrentDPI = 1 ; Setting of 125%
    {
         Send, {Tab 3}{Up}!{F4} ; Tab key is pressed three times, then Up Arrow, and then close the Display Settings window
         Return
    }
    else
    {
        MsgBox, "Current Scaling DPI is neither 100`% nor 125`%. The current value is %CurrentDPI%."" ; 100% = 0, 125% = 1, 150% = 2, 175% = 3, 200% = 4, 225% = 6, and so on.
        Return
    }
    This is great! I found it was slightly broken for me in Windows 11.

    I had to change the number of times tab was pressed from 3 to 8 to get to the DPI settings.
    I also changed the sleep time to 3000 so I could see the changes happening

    Finally, how do I amend it to go from 100% to 300% please?
      My Computer


  7. Posts : 32
    Windows 10
    Thread Starter
       #7

    3kboy said:
    This is great! I found it was slightly broken for me in Windows 11.

    I had to change the number of times tab was pressed from 3 to 8 to get to the DPI settings.
    I also changed the sleep time to 3000 so I could see the changes happening
    That is awesome! I don't even use this anymore since I got glasses, so I am happy to hear it continues to be useful to someone out there. Your post has put a smile on my face

    3kboy said:
    Finally, how do I amend it to go from 100% to 300% please?
    Going from 100% to 300%. I am still using Windows 10, so I cannot test this for myself. However, the script switches between resolutions by using the Up and Down arrow keys to switch between options in the Windows Scaling drop down menu. Currently Up or Down is only pressed once, as I only swap between 100% and 125% which are right next to each other. To switch to from 100% to 300% all you have to do is modify the number of times that it presses the Down and Up arrow to switch between options.

    Code:
    if CurrentDPI = 0 ; Setting of 100%
    {
        Send, {Tab 3}{Down}!{F4} ; Tab key is pressed three times, then Down Arrow, and then close the Display Settings window
        Return
    }
    else if CurrentDPI = 1 ; Setting of 125%
    {
         Send, {Tab 3}{Up}!{F4} ; Tab key is pressed three times, then Up Arrow, and then close the Display Settings window
         Return
    }
    I have color marked the relevant area you need to change in the code sample above. If you want the script to press the Down arrow four times, simply change it from {Down} to {Down 4}. Likewise, you could change {Up} to {Up 6}. Could you give that a try and let me know if it works for you?
      My Computer


  8. Posts : 7
    Windows 11
       #8

    Great, thanks, finally sussed it!

    Was so simple! All I did was run the ahk, when it kicked up a message saying "Current Scaling DPI is neither 100`% nor 300`%. The current value is %CurrentDPI%." I just had to amend the script to show that value.

    For me,
    100% = 4294967290
    300% = 1

    Another way to check this is, change the DPI settings and look in

    HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\

    See what the monitor number changes to and use that.

    For anyone else who may be interested, here's my code (I kept the longer delay in place, so the Resolution screen pops up and you see the cursor tab over to the DPI settings). Can obviously reduce this back down to 750 once finished troubleshooting it. I also changed the key to "Delete" as I didn't have Scroll Lock on my gaming keyboard

    Code:
    #Persistent ; Script continually runs
    #SingleInstance force ; If script is run a second time, it restart the instance already running
    
    DetectHiddenWindows, On
    ;Allows you to hide the CMD window. If you won't be hiding your CMD window, then no need to add this line.
    
    SetRegView 64
    ;Sets the registry view used by RegRead, allowing it in a 32-bit script to access the 64-bit registry view and vice versa.
    
    Delete:: ; the toggle key
    RunWait, %ComSpec% /c  %windir%\System32\DpiScaling.exe ; launch Settings -> Display
    RegRead, CurrentDPI, HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\SHP144A0_1E_07DF_CC^308AEBB00B16BB169DBCDF562C399811, DpiValue ; Determine the current scaling setting.
    
    Sleep, 4000 ; Time to wait in milliseconds for the Display Settings window to appear
    if CurrentDPI = 4294967290 ; Setting of 100%
    {
        Send, {Tab 8}{Down 7}!{F4} ; Tab key is pressed three times, then Down Arrow, and then close the Display Settings window
        Return
    }
    else if CurrentDPI = 1 ; Setting of 300%
    { 
         Send, {Tab 8}{Up 7}!{F4} ; Tab key is pressed three times, then Up Arrow, and then close the Display Settings window
         Return
    }
    else
    {
        MsgBox, "Current Scaling DPI is neither 100`% nor 300`%. The current value is %CurrentDPI%."" ; 100% = 0, 125% = 1, 150% = 2, 175% = 3, 200% = 4, 225% = 6, and so on.
        Return
    }
      My Computer


  9. Posts : 32
    Windows 10
    Thread Starter
       #9

    That is awesome! Glad to see you have it working. And great job figuring out another way to get the information you needed from the registry
      My Computer


  10. Posts : 1
    Windows 10
       #10

    Hello, I know this is an old post. But I am stuck at identifying the Monitor. For my PerMonitorSetting registry key, I have so many entries of the Monitor folders. I am not sure which one to choose from.

    Hotkey For Scaling In Windows 10?-perscreenmonitor.png

    Can you please help me find the right Monitor folder name?
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 02:39.
Find Us




Windows 10 Forums