Is there a way to toggle paintbrush in Photoshop by holding a key down?

I just had an idea and not sure if its possible. Can toggling the Paint Brush be done with a keyboard button instead of the mouse?

Say I hold the B key down with my off-hand while drawing using the mouse in my good hand.

Does anyone know if this is possible, and how?

Answer

In windows you can use Autohotkey to do this.

Autohotkey accompanied with the script below, will essentially do a mouse click every time you press b key.

Download the scripthere or alternatively copy it from below.

Once you have AHK installed, double click the script and it’ll start running right away.

To close the script: Right-click the script in the system tray and choose to Exit the script

Note that this essentially overrides your normal b key behavior, so be sure to exit the script when you don’t need it anymore. Also, you could set multiple key combinations instead of a single key.


…and here’s the code, if you don’t feel like downloading the file, or it’s not available anymore.

b:: Click down
b Up:: Click up

Copy the code and paste it into notepad or something and save it as .ahk.



As a bonus:

If you want to click a key to activate it and click a key again to deactivate it, you could do it with this code:

b::
if toggle := !toggle 
   Click down
else 
   Click up
return

Attribution
Source : Link , Question Author : Ryan , Answer Author : Joonas

Leave a Comment