How to Create Keyboard Shortcuts for Apps in Windows 11

Using AutoHotkey

Another method to create keyboard shortcuts for any Windows 11 app is to use a third-party app called AutoHotkey. AutoHotkey is a free and open source application that allows you to create scripts that can automate various tasks in Windows 11, including creating keyboard shortcuts.

With AutoHotkey, you can create more flexible and customizable keyboard shortcuts, since you can use any key, including F1 keys up to F12, Esc, or Print Screen, and you can add additional conditions or actions, such as checking if an app is open or not, or displaying a pop-up message.

Here are the steps to create a keyboard shortcut for any Windows 11 app using AutoHotkey:

  1. Download and install AutoHotkey from its official website: https://www.autohotkey.com/.
  2. Create a new text file in the location you want, for example on the desktop. You can use any text application, such as Notepad or WordPad.
  3. Rename the text file to the name you want, but make sure the extension is .ahk. For example, if you want to create a file for the Paint keyboard shortcut, you can name it Paint.ahk.
  4. Right-click on the .ahk file you just created, and then select Edit Script. This will open the file with the text app you are using.
  5. In the text file, type the AutoHotkey script that corresponds to the keyboard shortcut you want to create. The AutoHotkey script has the following general format:
Hotkey::Action

Where Hotkey is the key combination you want to use as a keyboard shortcut, and Action is the command you want to execute when pressing the keyboard shortcut. You can use any key as a hotkey, but you must add + marks for Shift, ^ marks for Ctrl, ! marks for Alt, and marks for Win.

For example, if you want to use Win+F1 as a hotkey, you must write F1. You can also use other symbols, such as < for left, > for right, ^ for top, and v for bottom.

For actions, you can use any command supported by AutoHotkey, but the most common is Run. The Run command lets you run an application, file, or folder by specifying its full location or path. For example, if you want to run Paint, you should write:

Run, C:\Windows\System32\mspaint.exe

You can find an app’s location or path by right-clicking on its icon and then selecting Open file location. You can also add additional options after the Run command, such as Min to minimize the application, Max to maximize the application, or Hide to hide the application. You can find a full list of AutoHotkey options and commands in the official documentation: https://www.autohotkey.com/docs/AutoHotkey.htm.

Here is an example AutoHotkey script to create a Win+F1 keyboard shortcut to run Paint:

F1::Run, C:\Windows\System32\mspaint.exe
  1. Save the text file, and then double-click on the.ahk file to run the script. You will see an AutoHotkey icon appear in the system tray, indicating that the script is active.
  2. Now, you can try your newly created keyboard shortcut. Press the key combination you selected, and you will see that the application will open automatically. If you create a keyboard shortcut for an app that’s already open, the keyboard shortcut moves focus to that app.

Here is a table showing some examples of AutoHotkey scripts you can create for any Windows 11 app:

ApplicationAutoHotkey script
Notepad F2::Run, C:\Windows\System32\notepad.exe
Calculator F3::Run, C:\Windows\System32\calc.exe
Microsoft Edge F4::Run, C:Program Files (x86)MicrosoftEdgeApplicationmsedge.exe
Spotify F5::Run, C:\Users%username%\AppData\Roaming\Spotify\Spotify.exe

You can create more complex AutoHotkey scripts by adding additional conditions or actions, such as checking whether an application is already open, or displaying a pop-up message. You can find more advanced examples of AutoHotkey scripts on its official website: https://www.autohotkey.com/docs/Scripts.htm.

Latest Articles