Add capslock+a to manually invoke window arrangement
This commit is contained in:
parent
0bb28b6f9a
commit
4a887dd1e2
26
main.ahk
26
main.ahk
@ -107,3 +107,29 @@ ArrangeWindows(wParam, lParam, msg, hwnd)
|
||||
; Listen for the monitor change event
|
||||
OnMessage(0x007E, ArrangeWindows)
|
||||
|
||||
CapsLock & a:: ; Capslock+a to arrange windows
|
||||
{
|
||||
keyArr := []
|
||||
For Key In monitorConfigurations
|
||||
keyArr.Push(Key)
|
||||
|
||||
selectionGui := Gui()
|
||||
selectionGui.AddText(, "Please select a window layout:")
|
||||
selectionGui.AddDropDownList("vLayoutChoice Choose1", keyArr)
|
||||
selectionGui.AddButton("", "Cancel").OnEvent("Click", Cancel)
|
||||
selectionGui.AddButton("Default X+", "Submit").OnEvent("Click", Submit) ; Place next previous button.
|
||||
selectionGui.Show()
|
||||
WinWaitClose(selectionGui.Hwnd)
|
||||
|
||||
Cancel(*)
|
||||
{
|
||||
WinClose(selectionGui.Hwnd)
|
||||
}
|
||||
|
||||
Submit(*)
|
||||
{
|
||||
Saved := selectionGui.Submit(true)
|
||||
monitorConfig := monitorConfigurations[Saved.LayoutChoice]
|
||||
ArrangeWindowsInMonitor(monitorConfig)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user