HimekoTachibana icon

Photoshop mouse shortcuts

HimekoTachibana | PRO | 09/19/13 11:14:59 PM UTC | 0 ⭐ | 826 👁️ | Never ⏰ | []
Autohotkey |

2.55 KB

|

None

|

0 👍

/

0 👎

; http://pastebin.com/vwCj8HYd
; Photoshop Mouse Shortcuts
; Assign Ctrl-Alt-H to Layer > Hide Layers in order for the right-click shortcut to work.
;
; Right-click: Toggle current layer visibility
; Middle-click: Toggle layer mask visibility
; Scroll wheel: Zoom
; Middle-click and drag: Pan
; Back button: Previous history state
; Forward button: Next history state
; Right + Left-click: Same as Alt + Left-click (Use to set clone brush source)
; Right + Scroll wheel: Increase/Decrease Brush Size
; Right + Back/Forward: Increase/Decrease Brush Opacity
; Right + Middle-click: Swap background and foreground colors
 
;*****************************************************************
;#IfWinActive, ahk_class Photoshop
#If WinActive("ahk_class Photoshop") || WinActive("ahk_class OWL.DocumentWindow")
    MouseIsOverDocument() {
        MouseGetPos,,, id, control, 2
        while (control != 0) {
            WinGetClass, Class, ahk_id %control%
            if(Class = "OWL.Document") {
                return true
            }
            control := DllCall("GetParent", "uint", control)
        }
        return false
    }
 
    WheelDown::
        if(MouseIsOverDocument()) {
            Send, ^{-}
        }
        else {
            Send {WheelDown}
        }
        return
    WheelUp::
        if(MouseIsOverDocument()) {
            Send, ^{=}
        }
        else {
            Send {WheelUp}
        }
        return
 
    XButton1::Send ^+z
    XButton2::Send ^!z
    RButton & WheelDown::Send [
    RButton & WheelUp::Send ]
    RButton & LButton::Send !{Click}
    RButton & MButton::Send x
    RButton & XButton1::Send {Enter}+{Down}{Enter}
    RButton & XButton2::Send {Enter}+{Up}{Enter}
    
    MouseX := 0
    MouseY := 0
 
    MButton::
        MouseGetPos MouseX, MouseY
        if(MouseIsOverDocument()) {
            Send, {Space down}
            if(GetKeyState(" ") = 1) {
                MouseClick, left,,,,,D
            }
            else {
                Send, {Space up}
            }
        }
        else {
            click middle
        }
        return
    MButton UP::
        if(GetKeyState(" ") = 1) {
            MouseClick, left,,,,,U
            Send, {Space up}
        }
        MouseGetPos x, y
        if(MouseX = x && MouseY = y && MouseIsOverDocument()) {
            Send \
        }
        return
                
    RButton::
        if (MouseIsOverDocument()) {
            Send ^!h
        }
        else {
            click right
        }
        return

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎