Skip to content

Instantly share code, notes, and snippets.

@thnikk
Created August 8, 2017 22:10
Show Gist options
  • Save thnikk/63e84db72b719bcf46ecb3ba250fa2de to your computer and use it in GitHub Desktop.
Save thnikk/63e84db72b719bcf46ecb3ba250fa2de to your computer and use it in GitHub Desktop.
Quick and dirty guide to remap keys using autohotkey

Remapping keypad keys to volume keys

So you want volume control or any other oddball keys that aren't supported by Arduino? Fret not, my friend, for this short guide will help you get your keys (and any keys) remapped quickly.

Let's say we're using ctrl+pg up/pg down for volume up and volume down. The reason we want to use something weird here is because AutoHotKey will remap all keys, including th keyboard keys. That means if you tell c and v to remap to volume up and volume down, c and v will also be unusable on your keybaord. Though it sounds harder, it's a pretty simple process.

Remapping your keypad keys

Download Termite from my website here

Follow the short guide on the page to make sure that you load the configuration file. From there the keypad itself will guide you through the remapping steps. To make it simpler, here's exactly what you have to enter. When it asks for the first key, enter ":1" (then press enter/return), ":22" (press enter/return), and then xx (enter/return) to finish that key. It will then ask for the next key and do the same this but enter :23 instead of :22. You need to enter xx at the end of each key because when you enter a special key, the keypad waits to see if you want any additional special keys. This is especially useful for this exact scenario since both ctrl and pg up/pg down are considered special keys.

Using AutoHotKey

Firstly, download and install the program from the website here

Secondly, make a file in your Documents folder called "autohotkey.ahk". AHK will automatically look for a .ahk file in your documents folder when it starts up. Edit the file with your favorite text editor and paste this into it:

^PgUp::Volume_Up
Return
^PgDn::Volume_Down
Return

All that we're telling it is to remap ctrl(^ here) and Pg up/dn to volume up and down. The two return lines are optional but they will help you if you ever want to add anything to this script.

Now you just need to launch AutoHotKey and it'll work!

@Tcip
Copy link

Tcip commented May 10, 2023

Thank you Thnikk for this guide. Unfortunately, your link Termite is broken. And it seems you haven't created a repo for it (unless I missed something that is).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment