|
|
|
@ -53,3 +53,86 @@ return |
|
|
|
|
Return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;Suspend hotkeys |
|
|
|
|
!s:: |
|
|
|
|
suspend, toggle |
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; Drag window anywhere |
|
|
|
|
Capslock & LButton:: |
|
|
|
|
CoordMode, Mouse |
|
|
|
|
MouseGetPos, EWD_MouseStartX, EWD_MouseStartY, EWD_MouseWin |
|
|
|
|
WinGetPos, EWD_OriginalPosX, EWD_OriginalPosY,,, % wTitle := "ahk_id " EWD_MouseWin |
|
|
|
|
mv_mode = mv |
|
|
|
|
SetTimer, EWD_WatchMouse, 10 |
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
; Resize window |
|
|
|
|
Capslock & RButton:: |
|
|
|
|
CoordMode, Mouse |
|
|
|
|
MouseGetPos, EWD_MouseStartX, EWD_MouseStartY, EWD_MouseWin |
|
|
|
|
WinGetPos, ,, EWD_OriginalPosX, EWD_OriginalPosY, % wTitle := "ahk_id " EWD_MouseWin |
|
|
|
|
mv_mode = sz |
|
|
|
|
SetTimer, EWD_WatchMouse, 10 |
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
; Drag window if LButton+RButton |
|
|
|
|
#If GetKeyState("LButton", "P") |
|
|
|
|
RButton:: |
|
|
|
|
CoordMode, Mouse |
|
|
|
|
MouseGetPos, EWD_MouseStartX, EWD_MouseStartY, EWD_MouseWin |
|
|
|
|
While GetKeyState("RButton", "P") { |
|
|
|
|
WinGetPos, EWD_OriginalPosX, EWD_OriginalPosY,,, % wTitle := "ahk_id " EWD_MouseWin |
|
|
|
|
mv_mode = mv |
|
|
|
|
SetTimer, EWD_WatchMouse, 10 |
|
|
|
|
Send {Esc} |
|
|
|
|
} |
|
|
|
|
return |
|
|
|
|
#If |
|
|
|
|
|
|
|
|
|
; Resize window if RButton+LButton |
|
|
|
|
#If GetKeyState("RButton", "P") |
|
|
|
|
LButton:: |
|
|
|
|
CoordMode, Mouse |
|
|
|
|
MouseGetPos, EWD_MouseStartX, EWD_MouseStartY, EWD_MouseWin |
|
|
|
|
While GetKeyState("LButton", "P") { |
|
|
|
|
WinGetPos, ,, EWD_OriginalPosX, EWD_OriginalPosY, % wTitle := "ahk_id " EWD_MouseWin |
|
|
|
|
mv_mode = sz |
|
|
|
|
SetTimer, EWD_WatchMouse, 10 |
|
|
|
|
KeyWait, Rbutton ;As soon as RButton is released... |
|
|
|
|
Send {Esc} ;... kill the context menu |
|
|
|
|
} |
|
|
|
|
return |
|
|
|
|
#If |
|
|
|
|
|
|
|
|
|
; Function for move and resize windows |
|
|
|
|
EWD_WatchMouse: |
|
|
|
|
CoordMode, Mouse |
|
|
|
|
MouseGetPos, EWD_MouseX, EWD_MouseY |
|
|
|
|
SetWinDelay, -1 ; Makes the below move faster/smoother. |
|
|
|
|
if mv_mode = mv |
|
|
|
|
{ |
|
|
|
|
GetKeyState, EWD_MButtonState, LButton, P |
|
|
|
|
WinGetPos, EWD_WinX, EWD_WinY,,, %wTitle% |
|
|
|
|
WinMove, %wTitle%,, EWD_WinX + EWD_MouseX - EWD_MouseStartX, EWD_WinY + EWD_MouseY - EWD_MouseStartY |
|
|
|
|
} |
|
|
|
|
if mv_mode = sz |
|
|
|
|
{ |
|
|
|
|
GetKeyState, EWD_MButtonState, RButton, P |
|
|
|
|
WinGetPos, ,, Width, Height, %wTitle% |
|
|
|
|
WinMove, %wTitle%,,,, Width + EWD_MouseX - EWD_MouseStartX, Height + EWD_MouseY - EWD_MouseStartY |
|
|
|
|
} |
|
|
|
|
if EWD_MButtonState = U |
|
|
|
|
{ |
|
|
|
|
SetTimer, EWD_WatchMouse, off |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
EWD_MouseStartX := EWD_MouseX |
|
|
|
|
EWD_MouseStartY := EWD_MouseY |
|
|
|
|
WinActivate %wTitle% |
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|