AutoHotKey script for switching between dark/light mode in Windows 10 works great in PDF-xchange editor

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

MedBooster
User
Posts: 1385
Joined: Mon Nov 15, 2021 8:38 pm

AutoHotKey script for switching between dark/light mode in Windows 10 works great in PDF-xchange editor

Post by MedBooster »

For the background change to "dark mode"-ish I use the accessibility settings and I have a keyboard shortcut set to turn it on and off as well
See this post for reference: viewtopic.php?t=40155

However, I wanted to share this Autohotkey script which changes the system between dark mode / light mode (take that Lenovo! (no point in adding a dedicated dark mode key to your keyboard... you could have at least added it as a keyboard combination for Fn+End and added an Home PgUp PgDown End row instead – anyway i digress...

If you set the user interface appearance to use system colors (dark/light mode) the system as well as PDF-xchange editor itself switches to and from "dark mode" within 10 seconds, using a keyboard shortcut of your choice
image.png
Here's the script:
(#+L::toggleDarkMode() means the keyboard shortcut is Win+shift+L , so you can change this)
You might have to have the script as a separate script from other ones, as they might interfere with each other if you paste it in with too many others

Code: Select all

;reference https://www.reddit.com/r/AutoHotkey/comments/p279f5/dark_modelight_mode_toggle_for_windows_10/

#+L::toggleDarkMode()

toggleDarkMode()
{
    static key := "", mode
    if !key
        RegRead mode, % key := "HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize", SystemUsesLightTheme
    mode ^= 1
    RegWrite REG_DWORD, % key, AppsUseLightTheme   , % mode
    RegWrite REG_DWORD, % key, SystemUsesLightTheme, % mode
}
You do not have the required permissions to view the files attached to this post.
My wishlist https://forum.pdf-xchange.com/viewtopic.php?p=187394#p187394
Disable SPACE page navigation, fix kb shortcut for highlighting advanced search tool search field, bookmarks with numbers, toolbar small icon size, AltGr/Ctrl+Alt keyboard issues
krstoevan
User
Posts: 61
Joined: Thu Jan 12, 2023 3:00 pm

Re: AutoHotKey script for switching between dark/light mode in Windows 10 works great in PDF-xchange editor

Post by krstoevan »

guy

you are simply change the UI... the buttons, the menus, the toolbars color.

i dont read them.

i read the PDF, the text , the background.

and i have complainted that pdfxce wont change the color of scanned white pages while competitors can.
MedBooster
User
Posts: 1385
Joined: Mon Nov 15, 2021 8:38 pm

Re: AutoHotKey script for switching between dark/light mode in Windows 10 works great in PDF-xchange editor

Post by MedBooster »

krstoevan wrote: Sat Apr 08, 2023 4:11 pm guy

you are simply change the UI... the buttons, the menus, the toolbars color.

i dont read them.

i read the PDF, the text , the background.

and i have complainted that pdfxce wont change the color of scanned white pages while competitors can.
Hello krstoevan, happy Easter.



I would be interested in seeing what complaints about "change the color of scanned white pages while competitors can." you are referring to. Could you send a link to the thread/post you are referring to if there is one on the forum?
My wishlist https://forum.pdf-xchange.com/viewtopic.php?p=187394#p187394
Disable SPACE page navigation, fix kb shortcut for highlighting advanced search tool search field, bookmarks with numbers, toolbar small icon size, AltGr/Ctrl+Alt keyboard issues
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11586
Joined: Wed Jan 03, 2018 6:52 pm

Re: AutoHotKey script for switching between dark/light mode in Windows 10 works great in PDF-xchange editor

Post by Daniel - PDF-XChange »

Hello, MedBooster

I believe this is the topic in question: viewtopic.php?t=40151

in any case, Thank you for the helpful script, I am sure that some AHK users here will find that to be fairly helpful.

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com