diff --git a/main.ahk b/main.ahk index d68e48a..2a18856 100644 --- a/main.ahk +++ b/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) + } +} \ No newline at end of file