Not quite on topic, but I feel it is still relevant and worth sharing.
I use AutoHotKey and a "KDEStyle" script that I found long ago and have adapted to improve the use of the mouse for this purpose.
- Win + Left Click
- Allows you to move the window by clicking anywhere inside it.
- Win + Right Click
- Allows you to resize the window using the closest corner - again clicking anywhere inside it.
This significantly reduces the required precision, and in my opinion makes it much easier and faster to use the mouse for such purposes.
#LButton::
MouseGetPos,KDE_X1,KDE_Y1,KDE_id
WinGet,KDE_Win,MinMax,ahk_id %KDE_id%
if KDE_Win
return
WinGetPos,KDE_WinX1,KDE_WinY1,,,ahk_id %KDE_id%
loop {
GetKeyState,KDE_Button,LButton,P
if KDE_Button = U
break
MouseGetPos,KDE_X2,KDE_Y2
KDE_X2 -= KDE_X1
KDE_Y2 -= KDE_Y1
KDE_WinX2 := (KDE_WinX1 + KDE_X2)
KDE_WinY2 := (KDE_WinY1 + KDE_Y2)
WinMove,ahk_id %KDE_id%,,%KDE_WinX2%,%KDE_WinY2%
}
return
#RButton::
MouseGetPos,KDE_X1,KDE_Y1,KDE_id
WinGet,KDE_Win,MinMax,ahk_id %KDE_id%
if KDE_Win
return
WinGetPos,KDE_WinX1,KDE_WinY1,KDE_WinW,KDE_WinH,ahk_id %KDE_id%
if (KDE_X1 < KDE_WinX1 + KDE_WinW / 2) {
KDE_WinLeft := 1
} else {
KDE_WinLeft := -1
}
if (KDE_Y1 < KDE_WinY1 + KDE_WinH / 2) {
KDE_WinUp := 1
} else {
KDE_WinUp := -1
}
loop {
GetKeyState,KDE_Button,RButton,P
if KDE_Button = U
break
MouseGetPos,KDE_X2,KDE_Y2
WinGetPos,KDE_WinX1,KDE_WinY1,KDE_WinW,KDE_WinH,ahk_id %KDE_id%
KDE_X2 -= KDE_X1
KDE_Y2 -= KDE_Y1
WinMove,ahk_id %KDE_id%,, KDE_WinX1 + (KDE_WinLeft+1)/2*KDE_X2
, KDE_WinY1 + (KDE_WinUp+1)/2*KDE_Y2
, KDE_WinW - KDE_WinLeft *KDE_X2
, KDE_WinH - KDE_WinUp *KDE_Y2
KDE_X1 := (KDE_X2 + KDE_X1)
KDE_Y1 := (KDE_Y2 + KDE_Y1)
}
return
Standard Windows keyboard combinations then complement this and allow you to:
- Win + Up / Down
- Maximise / Restore / Minimize
- Win + Left / Right
- Resise to left / right half of screen
- Win + Shift + Left / Right
- Move one monitor left / right
- etc...