DranDane
Joined: 26 Jun 2007 Posts: 54
|
Posted: Mon Mar 17, 2008 5:11 pm Post subject: Quick resize windows with the keyboard only |
|
|
Hello,
This script allow you to resize your widow quickly on the left, up, right or bottom of the screen by using the command "winkey" + left, right, up or down key. Usefull for people that use the keyboard to control windows.
| Code: |
; Author: Dran Dane <drandane-forums@yahoo.fr>
;
; Script Function: This script allow you to resize your widow quickly on the left, up, right or bottom of the screen by using the command "winkey" + left, right, up or down key. Usefull for people that use the keyboard to control windows.
;
#SingleInstance force
#Persistent
;#NoTrayIcon
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Hotstring B0 *
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;#Include %A_ScriptDir%\Includes\KeyList.ahk
;#Include %A_ScriptDir%\Includes\TTS.ahk
#Down::
Sysget, MonitorWorkArea, MonitorWorkArea
IfWinActive, A
{
if IsDown()
{
WinMinimize, A
}
else
{
if IsUp()
{
WinMove ,,,0, 0, MonitorWorkAreaRight, MonitorWorkAreaBottom
}
else
{
WinMove ,,,0, (MonitorWorkAreaBottom/2), MonitorWorkAreaRight, (MonitorWorkAreaBottom/2)
}
}
}
return
#Up::
Sysget, MonitorWorkArea, MonitorWorkArea
IfWinActive, A
{
if IsUp()
{
WinMaximize, A
}
else
{
if IsDown()
{
WinMove ,,,0, 0, MonitorWorkAreaRight, MonitorWorkAreaBottom
}
else
{
WinMove ,,,0, 0, MonitorWorkAreaRight, (MonitorWorkAreaBottom/2)
}
}
}
return
#Left::
Sysget, MonitorWorkArea, MonitorWorkArea
IfWinActive, A
{
if IsRight()
{
WinMove ,,,0, 0, MonitorWorkAreaRight, MonitorWorkAreaBottom
}
else
{
WinMove ,,,0, 0, (MonitorWorkAreaRight/2), MonitorWorkAreaBottom
}
}
return
#Right::
Sysget, MonitorWorkArea, MonitorWorkArea
IfWinActive, A
{
if IsLeft()
{
WinMove ,,,0, 0, MonitorWorkAreaRight, MonitorWorkAreaBottom
}
else
{
WinMove ,,,(MonitorWorkAreaRight/2), 0, (MonitorWorkAreaRight/2), MonitorWorkAreaBottom
}
}
return
IsDown()
{
WinGetPos, X, Y, Width, Height, A
Sysget, MonitorWorkArea, MonitorWorkArea
if (X = 0 && Y = MonitorWorkAreaBottom/2 && Width = MonitorWorkAreaRight && Height = MonitorWorkAreaBottom/2)
return true
return false
}
IsUp()
{
WinGetPos, X, Y, Width, Height, A
Sysget, MonitorWorkArea, MonitorWorkArea
if (X = 0 && Y = 0 && Width = MonitorWorkAreaRight && Height = MonitorWorkAreaBottom/2)
{
return true
}
return false
}
IsLeft()
{
WinGetPos, X, Y, Width, Height, A
Sysget, MonitorWorkArea, MonitorWorkArea
if (X = 0 && Y = 0 && Width = MonitorWorkAreaRight/2 && Height = MonitorWorkAreaBottom)
{
return true
}
return false
}
IsRight()
{
WinGetPos, X, Y, Width, Height, A
Sysget, MonitorWorkArea, MonitorWorkArea
if (X = MonitorWorkAreaRight/2 && Y = 0 && Width = MonitorWorkAreaRight/2 && Height = MonitorWorkAreaBottom)
{
return true
}
return false
}
|
|
|