Advertisement
Guest User

Photoshop Mouse Shortcuts

a guest
Sep 19th, 2013
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Photoshop Mouse Shortcuts
  2. ; Assign Ctrl-Alt-H to Layer > Hide Layers in order for the right-click shortcut to work.
  3. ;
  4. ; Right-click: Toggle current layer visibility
  5. ; Middle-click: Toggle layer mask visibility
  6. ; Scroll wheel: Zoom
  7. ; Middle-click and drag: Pan
  8. ; Back button: Previous history state
  9. ; Forward button: Next history state
  10. ; Right + Left-click: Same as Alt + Left-click (Use to set clone brush source)
  11. ; Right + Scroll wheel: Increase/Decrease Brush Size
  12. ; Right + Back/Forward: Increase/Decrease Brush Opacity
  13. ; Right + Middle-click: Swap background and foreground colors
  14.  
  15. ;*****************************************************************
  16. ;#IfWinActive, ahk_class Photoshop
  17. #If WinActive("ahk_class Photoshop") || WinActive("ahk_class OWL.DocumentWindow")
  18.     MouseIsOverDocument() {
  19.         MouseGetPos,,, id, control, 2
  20.         while (control != 0) {
  21.             WinGetClass, Class, ahk_id %control%
  22.             if(Class = "OWL.Document") {
  23.                 return true
  24.             }
  25.             control := DllCall("GetParent", "uint", control)
  26.         }
  27.         return false
  28.     }
  29.  
  30.     WheelDown::
  31.         if(MouseIsOverDocument()) {
  32.             Send, ^{-}
  33.         }
  34.         else {
  35.             Send {WheelDown}
  36.         }
  37.         return
  38.     WheelUp::
  39.         if(MouseIsOverDocument()) {
  40.             Send, ^{=}
  41.         }
  42.         else {
  43.             Send {WheelUp}
  44.         }
  45.         return
  46.  
  47.     XButton1::Send ^+z
  48.     XButton2::Send ^!z
  49.     RButton & WheelDown::Send [
  50.     RButton & WheelUp::Send ]
  51.     RButton & LButton::Send !{Click}
  52.     RButton & MButton::Send x
  53.     RButton & XButton1::Send {Enter}+{Down}{Enter}
  54.     RButton & XButton2::Send {Enter}+{Up}{Enter}
  55.    
  56.     MouseX := 0
  57.     MouseY := 0
  58.  
  59.     MButton::
  60.         MouseGetPos MouseX, MouseY
  61.         if(MouseIsOverDocument()) {
  62.             Send, {Space down}
  63.             if(GetKeyState(" ") = 1) {
  64.                 MouseClick, left,,,,,D
  65.             }
  66.             else {
  67.                 Send, {Space up}
  68.             }
  69.         }
  70.         else {
  71.             click middle
  72.         }
  73.         return
  74.     MButton UP::
  75.         if(GetKeyState(" ") = 1) {
  76.             MouseClick, left,,,,,U
  77.             Send, {Space up}
  78.         }
  79.         MouseGetPos x, y
  80.         if(MouseX = x && MouseY = y && MouseIsOverDocument()) {
  81.             Send \
  82.         }
  83.         return
  84.                
  85.     RButton::
  86.         if (MouseIsOverDocument()) {
  87.             Send ^!h
  88.         }
  89.         else {
  90.             click right
  91.         }
  92.         return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement