Advertisement
Lorenzo501

LButton Snip Hotkey (redundant).ahk

May 24th, 2024
531
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; THIS ONE IS WORSE ACTUALLY, IT MAKES THE EXTRA SNIPPING TOOL FEATURES USELESS (SUCH AS WINDOW SNIP)
  2.  
  3. #Requires AutoHotkey 2.0
  4. CoordMode("Mouse", "Screen")
  5. snipCursor := {StartX: unset, StartY: unset} ; Ad hoc object, usable w/ dot notation (no need for class)
  6. #HotIf WinActive("ahk_exe ScreenClippingHost.exe")
  7. ; can use WIN+SHIFT+S to take snips for now w/o the help of AHK
  8.  
  9. ~*LButton::
  10. {
  11.     MouseGetPos(&startCursorX, &startCursorY)
  12.     snipCursor.StartX := startCursorX
  13.     snipCursor.StartY := startCursorY
  14. }
  15.  
  16. ~*LButton Up:: ;msgbox A_TimeSincePriorHotkey
  17. {
  18.     MouseGetPos(&endCursorX, &endCursorY)
  19.     desktop := " / " A_ScreenWidth " x " A_ScreenHeight
  20.  
  21.     if (Abs(snipCursor.StartX - endCursorX) > 10 && Abs(snipCursor.StartY - endCursorY) > 10)
  22.         MsgBox(Abs(snipCursor.StartX - endCursorX) " x " Abs(snipCursor.StartY - endCursorY) desktop)
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement