Photoshop and AutoHotKey the perfect pair

Ever wanted to create hotkeys in photoshop but you couldn’t because photoshop didn’t allow that hotkey combination? Or wanted to use the TAB key for something else?

There’s a free program that allows you to use keys such as TAB, numlock, scrolllock, printscreen or the break key and map it to something usefull. That program is called AutohotKey. You can download it for free and unleash all that power here: Download Autohotkey

For example here’s how you would map the numlock key to send out F11 which you could map to whatever in photoshop. I like everything on my numerical keyboard so I can just keep my hand there and have everything I need in reach.

#ifWinActive ahk_class Photoshop
{
NumLock::
{
Send {F11}
Sleep, 100
return
}
}

If you look at your numerical keyboard and place your hand there, look at how many usefull keys are in reach of your fingers without mocing your hand.

Numpad minus
Numpad plus
Numpad divide
Numpad multiply
Numpad comma
Numlock
Printscreen
Scrolllock
Break key
page up
page down
home
end
insert
delete

All those keys are sitting there useless when you could bind them to all the stuff you use all the time and never have to move your hand.

That’s not all, you can also bind the mouse buttons to something usefull. Here a couple of scripts I use:

Bind your pen up button to W and now you can rotate the canvas by dragging the pen around.
#ifWinActive ahk_class Photoshop
{
w::
{
send {r down}
Loop
{
sleep, 10
GetKeyState, state, w, p
if state = u
break
}
send {b}
return
}
}

Bind your pen down button to S and resize the brush on the fly by dragging left and right.
#ifWinActive ahk_class Photoshop
{
s::
{
send {alt down}
mouseclick, right,,, 1, 0, d
Loop
{
sleep, 10
GetKeyState, state, s, p
if state = u
break
}
mouseclick, right,,, 1, 0, U
send {alt up}
return
}
}

Here’s an example of using the insert key to send out control+shift+n, use the photoshop keyboard editor to bind that to something you need. You can modify this script and make copies of it to match Numlock, printscreen or any other key.
#ifWinActive ahk_class Photoshop
{
insert::
{
send {Control down} {Shift down} n {Shift up} {Control up}
return
}

}

Here’s some examples for numlock and printscreen:


#ifWinActive ahk_class Photoshop
{
PrintScreen::
{
Send {Control down}{Alt down}{LShift down}h{LShift up}{Alt up}{Control up}
Sleep, 100
return
}
}

#ifWinActive ahk_class Photoshop
{
NumLock::
{
Send {F11}
Sleep, 100
return
}
}

But that’s not all, this one is going to blow your mind baby so don’t skip it!

Since I like everything around the numerical keyboard I want to be able to bind as much stuff to those keys. AutoHotKey also allows you to create your own modifier keys.

A modifier key is a key that while held down modifies any other key, like ALT+S, while ALT is held down S works differently.

How about we make numpad divide a modifier key looking for another press of numpad multiply?

#ifWinActive ahk_class Photoshop
{
NumpadDiv & NumPadMult::
{
Send, {control down}{F8}{control up}
Sleep, 100
return
}

}

The only drawback is that the first key (The modifier) looses its normal function unless you make another script to handle that.

In the example above, in photoshop the numpad divide key would lose its ability to work, so we write a new script to catch that.

#ifWinActive ahk_class Photoshop
{
NumpadDiv::
{
Send, {control down}{F5}{control up}
Sleep, 100
return
}

}

Now AutoHotKey knows that if you press and then release the divide key then it catches that key, if you press divide and multiply then it knows that it has to catch that instead.

If you sit and let all this sink in for a while, imagine all the combinations of keys you can bind to the numerical keyboard, you can operate every single thing in photoshop without moving your hand of the numerical keyboard.

The only keys on the numerical side of the keyboard you should leave alone is the numbers 0-9 as they are used to control transparency of the brush and layers. That doesn’t stop you from making modifier combos out of them. Just catch numpad1 & numpad2, then make sure you also create a section for numpad1 and send out numpad1 so that when you only press and release numpad1 it works like normal.

You could be sneaky and make your arrow keys your modifiers, so that when you press arrow left + numpad1 it’s one thing, when you press arrow up + numpad1 it’s another and so on, that’s 104 combos worth of keys right at your fingertips.

Se also: Changing Photoshop Hardcoded Shotcut Keys

You must be logged in to post a comment.