A lightweight, portable AutoHotkey v2 application that transforms a single key on a specific secondary keyboard, numpad, or foot pedal into a powerful multi-action macro button.
Unlike standard AutoHotkey scripts that trigger globally across all keyboards, this app uses the Windows Raw Input API to listen to a specific hardware device. This allows you to use cheap secondary keyboards as dedicated macro pads without installing kernel-level drivers (such as AutoHotInterception) or disabling Secure Boot.
Triggers macros only when the target key is pressed on your designated hardware (filtered via Vendor ID and Product ID). The same key on your main keyboard continues to work normally.
Reliably detects:
- Single Press
- Double Press
- Long Hold
All from one physical key.
Open any executable, file, or document.
Launch websites instantly in your default browser.
Record and replay complex keyboard combinations including:
CtrlShiftAltWin
Instantly switch Windows audio output devices using NirSoft's SoundVolumeView.
A built-in graphical interface accessible from the System Tray to:
- Edit shortcuts
- Configure press types
- Adjust timing delays
- Toggle admin/startup settings
Because this script runs in User Mode (without custom drivers), it intercepts the keyboard signal after Windows receives it.
When the macro key is pressed:
- Windows briefly types the character.
- The script detects the device hardware ID.
- It instantly sends Backspace to erase the character.
- Your macro action is executed.
You may occasionally see a very brief flicker of the character if you are typing extremely fast. This is normal behavior for driverless interception.
To make the script listen only to your custom foot switch and run on any PC without installing AutoHotkey, follow these steps.
Install the following tools:
-
AutoHotkey v2 https://www.autohotkey.com/
You can build a dedicated macro switch using an old keyboard PCB and a cheap foot pedal switch (like this one on Amazon).
- Take the PCB from a cheap membrane keyboard.
- Plug the bare PCB into your computer via USB.
- Use a wire to short different pin pairs to see which key gets registered.
- Once you find the key you want (example:
Numpad *), solder two wires to those pins. - Connect the wires to your external foot pedal switch.
Open final.ahk and locate this line near the top:
global targetKey := "NumpadMult"Replace "NumpadMult" with the name of the key your PCB produced when you shorted the pins.
You can find all AutoHotkey key names here: https://www.autohotkey.com/docs/v2/KeyList.htm
To ensure the shortcut only triggers on your foot switch, you must identify the hardware device ID.
Download and run this script: https://github.com/SAPNXTDOOR/Keyboard-VID-and-PID-identifier/blob/main/keyboard_detector.py
The script will print a device string similar to:
\\?\HID#VID_04F3&PID_152E
Open final.ahk and find:
global targetDeviceID := "\\?\HID#VID_04F3&PID_152E"Replace the value with the exact string returned by the Python script.
To use the Change Output Device action:
- Download SoundVolumeView from NirSoft
- Create a folder named:
audio
- Place this file inside it:
SoundVolumeView.exe
Directory structure example:
ShortcutManager
├── ShortcutManager.exe
├── config.txt
├── settings.ini
└── audio
└── SoundVolumeView.exe
To run the app on any PC without installing AutoHotkey:
- Open Start Menu
- Launch AutoHotkey Dash
- Click Compile
Then:
- Select your file:
final.ahk
- Choose the correct base file:
AutoHotkey64.exe
- Click Convert
This will generate a standalone executable.
Once compiled, you can delete:
*.ahk
*.py
Only these files are required to run the app:
ShortcutManager.exe
config.txt
settings.ini
audio/SoundVolumeView.exe
- Run the compiled:
ShortcutManager.exe
-
Locate the green "H" icon in the Windows system tray.
-
Open the GUI:
- Double click the tray icon or
- Right click → Edit Shortcut
- Choose your Press Type
Single
Double
Hold
- Select the Action Type
Examples:
Launch App
Open URL
Macro
Change Output Device
- Enter the action value and click Save.
NumpadMult|single|app|notepad.exe
NumpadMult|double|url|https://google.com
NumpadMult|hold|audio|Headphones
- Foot pedal for Push-to-Talk
- Dedicated streaming macro button
- Audio device switching
- Video editing shortcuts
- Accessibility tools
- Cheap DIY Stream Deck alternative
- AutoHotkey v2
- Python
- Windows Raw Input API
- SoundVolumeView (NirSoft)