F13-F24 with CapsLock is a simple but useful AutoHotkey v2 (AHK2) script that enhances the functionality of the Caps Lock
key. When Caps Lock
is enabled, the F1
-F12
keys are remapped to F13
-F24
. The status is displayed in the systray icon and for a short time on a tooltip in the bottom right corner.
While the remapping is really simple and can be done in less than 20 lines of code (see below), I wanted to create a script that covers many AutoHotkey functionalities that are often asked about on the official AutoHotkey Forum, Reddit, and Stackoverflow communities. I tried to comment the script as much as possible without being too verbose.
This script demonstrates examples of:
- Hotkeys with HotIf
- String concatenation
- Switch cases
- Caps Lock usage
- Customized systray menu
- Use of message boxes (MsgBox)
- GUI Window with buttons
- Dynamic systray icon changes
- ToolTip text with absolute positioning in the bottom right corner
- Separate AHK files (#include)
- Installation of files from the compiled EXE (FileInstall)
- Use of AutoHotkey's A_Temp variable to store icons and license files away from the user's eyes
- Use of AutoHotkey's IsCompiled variable for compiling with AHK2EXE
- OS Language detection with the A_Language variable
- A Windows PC, 32-bit or 64-bit
- AutoHotkey v2 (for the source code version)
This application is created and compiled using AutoHotkey 2.0.17. It features a straightforward script that remaps the F1
to F12
keys to F13
to F24
when the Caps Lock key is pressed. Pressing the Caps Lock key again disables the remapping and restores the F1
to F12
keys.
Shift does not affect the remapping. For instance, if you press Shift+F1
while Caps Lock is enabled, the system will interpret it as Shift+F13
.
This script is compatible with any application that supports the additional function keys (F13
-F24
), such as:
- DAWs (Digital Audio Workstations) like Bitwig Studio, Ableton Live, FL Studio, Cubase, etc.
- Graphic editors like Photoshop, GIMP, Krita, Inkscape, etc.
- CAD software like AutoCAD, SolidWorks, etc.
- Video editors like Adobe Premiere, DaVinci Resolve, etc.
- Broadcasting software like OBS, Streamlabs, etc.
- Code editors like Visual Studio Code, Atom, Sublime Text, etc.
- Other AutoHotkey scripts
- Download and install AutoHotkey v2.
- Clone this repository.
- Run the script by double-clicking the
.ahk
file.
To download the latest compiled executable without needing to install AutoHotkey, follow these steps:
- Visit the releases page on GitHub.
- Download the compiled
.exe
file from the repository. Choose between the 32-bit and 64-bit versions. - Run the downloaded executable by double-clicking the
.exe
file.
- Use the Caps Lock key to switch between
F1
-F12
andF13
-F24
functionalities. - Right-click on the systray icon to open the menu for Help, view the About, License or to Exit the application.
- Help open a simple message box with a help message in 5 languages (English, German, Spanish, French, Italian) detected by the OS language.
- About opens a message box with some info about the author in 5 languages (English, German, Spanish, French, Italian) detected by the OS language.
- License opens a message box with the MIT License (English only)
- Exit closes the application without asking for confirmation.
- The compiled version also removes the content created in the user temp folder (
C:\Users\%USERNAME%\AppData\Local\Temp\F13F24
by default) during the script execution.
- The compiled version also removes the content created in the user temp folder (
If you just need a simple remapping of the F1
-F12
keys to implement in your script, this is all you need:
#HotIf GetKeyState("CapsLock", "T")
F1::F13
F2::F14
F3::F15
F4::F16
F5::F17
F6::F18
F7::F19
F8::F20
F9::F21
F10::F22
F11::F23
F12::F24
#HotIf
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please fork the repository and create a pull request with your changes.
See the CHANGELOG.md file for details.
If you have any questions or suggestions, feel free to open an issue on GitHub or contact me at centomila.com.
Made with ❤️ by Centomila. If you found this application useful or inspiring, consider checking out my music and sharing it with others! You can find my discography at centomila.com.