Page 1 of 1

Autohotkey script: increment/decrement values with pen

Posted: 18 Sep 2009, 12:51
by KenC
Here's an autohotkey script I came up with to change values up/down with the mouse/pen.

This allows you to setup hotkeys in TVPaint and then hit a hotkey assigned with Autohotkey to move the cursor up/down to change a value.

Some things you can do:

Hue up/down
Saturation up/down
Luminance up/down
Size up/down
Zoom in/out
Rotate canvas left/right

Basically anything that can be assigned 2 hotkeys in TVPaint to inc/dec a value can be done. Hit the key once and move the cursor up and down, hit the key again to continue working.

You just hit the hotkey and move the cursor on the screen and values go up or down.

If you don't have Autohotkey you can download it for free at:

Just copy the script from below and paste it into a text file with an .ahk extension and name it whatever you want. Doubleclick the file to run it. You can put it into your windows startup folder so it always starts with windows. Don't know about Mac.

You have to change a few easy things to hook it up to whatever keys you want. You can copy the section below and paste it multiple times with different keys to duplicate it for the things you want. Just look at the comments in the script to see what you have to change.

If you have TVPaint standard change the first line to:

#ifWinActive ahk_class TVP Animation 9

Code: Select all

#ifWinActive ahk_class TVP Animation 9 Pro
;Mess with this if moving the pen takes to much CPU
setbatchlines, 500ms 

#MaxThreadsPerHotkey 2


Coordmode, mouse, Screen

;This is the shortcut (m) you use to activate, look in AHK Help for special keycodes.
;Make sure this key is not bound to any function you need in TVPaint as this key will override that key.
    MouseGetPos,, old_mousey 

    if bbrake 
    else if !bbrake 

        MouseGetPos,, mousey 
        if ((mousey=old_mousey) and (bbrake != 1)) 
        else if bbrake=1 
        if (mousey > old_mousey) 
;Cursor move up. Change to a key you have set in TVPaint to increase something.
            send, {numpad4} 
        else if (mousey < old_mousey) 
;Cursor move down. Change to a key you have set in TVPaint to decrease something.
            send, {numpad6} 



Any questions just ask and I'll see if I can help.