AutoHotkey: Remapping the numpad keys for drawing (Windows only)

This tutorial will show you how to change the numpad keys into common shortcuts for drawing, like undo/redo/transform/etc.

It will also show you how to toggle between two scripts, in case you like to switch between applications while working. 

-

This is useful if you have a large keyboard with a numpad, such as a ergonomic keyboard.

This is also useful if you are remapping an external numpad. It's like a budget-friendly alternative to the Razer Orbweaver or the Wacom ExpressKey Remote.

Remapping a game controller with AutoHotkey might be possible, but I'm not sure how to do it. You can find more information on the Joystick subsection of the AHK key list. You can also use JoyToKey.

If you would like for this script to run at startup, here is how to do that. This is useful if you want to semi-permanently remap a set of keys. In this case, the "app" would be the .AHK script itself, not the AHK app.

-

First, download AutoHotkey.

Once you install AHK, right click on the the desktop to create a new script. Name it whatever you'd like.

C3966faf6f004f34457f8b6d3911c9db

Now, right click on the file and select "Edit Script". 

It will open up Notepad with the brand new script. There's some boilerplate code that you can leave alone.

B401313cb2a4f3cc871ae6db9c32e427

Here is a basic script that uses Numpad0-9 and NumpadDot for shortcuts.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

Numpad7::b
Numpad8::i
Numpad9::e

Numpad4::^z
Numpad5::Space
Numpad6::^+z

Numpad1::^t
Numpad2::g
Numpad3::^d

Numpad0::m
NumpadDot::l

This is the most straightforward way to remap keys. The key you press is on the left side of the double colon, and the keys you want to remap it to are on the right side.

There are some symbols here that correspond to modifier keys. ^ is Ctrl, + is Shift, and ! is Alt.

You can see the full list of input/output keys for AHK here.

-

To launch a script, double click on the file. You should see a green AutoHotkey icon pop up on the bottom right of your screen.

Make sure you have saved you script, and that numlock is on. 

When numlock is off, it's sending an entirely different input, ex.: NumpadPgUp instead of Numpad9.

763bbaf1f1e6e552ef41ed5c119ef73a

Here is an expanded script. I've left the new inputs blank.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

Insert::
Pause::

Home::
Del::
End::
PgUp::
PgDn::

NumpadDiv::
NumpadMult::
NumpadSub::
NumpadAdd::
NumpadEnter::

Numpad7::b
Numpad8::i
Numpad9::e

Numpad4::^z
Numpad5::Space
Numpad6::^+z

Numpad1::^t
Numpad2::g
Numpad3::^d

Numpad0::m
NumpadDot::l


6927290f59d7e1b9cceae0ff077325de

You can also add a hotkey to toggle between two scripts.

To do this, first make sure that both scripts are in the same folder. I have both of them on the desktop.

Write each script with the shortcuts you'd use in the specific application. Reserve one key for the toggle.

Then, paste this for the toggle:

[Key you've reserved]::
SoundPlay, *[16 or 64. This line is optional. Simply alerts you that you've toggled the script]
Run [script you want to run]
ExitApp [script that is currently running]
Return

Thank you for reading! I hope you found this tutorial useful. :>

See you around!