diff options
author | John Ankarström <john@ankarstrom.se> | 2021-08-24 23:29:58 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-08-24 23:29:58 +0200 |
commit | a8706780b37142ada91fd93371f14a60f6aa4301 (patch) | |
tree | 6c665cb599f41adfecdf72f2cb77106c562fef15 | |
parent | 3222073596b250410e557807404d188ae355e945 (diff) | |
download | ahk-a8706780b37142ada91fd93371f14a60f6aa4301.tar.gz |
windowselect: Add new, special hotkeys
-rw-r--r-- | tt.windowselect.ahk | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/tt.windowselect.ahk b/tt.windowselect.ahk index 889c735..eb67413 100644 --- a/tt.windowselect.ahk +++ b/tt.windowselect.ahk @@ -2,6 +2,18 @@ ;; -> body +*#1::QuickLaunch(1) +*#2::QuickLaunch(2) +*#3::QuickLaunch(3) +*#4::QuickLaunch(4) +*#5::QuickLaunch(5) +*#6::QuickLaunch(6) +*#7::QuickLaunch(7) +*#8::QuickLaunch(8) +*#9::QuickLaunch(9) +*#0::QuickLaunch(10) + +/* #1::Taskbar(1) #2::Taskbar(2) #3::Taskbar(3) @@ -12,9 +24,58 @@ #8::Taskbar(8) #9::Taskbar(9) #0::Taskbar(10) +*/ + +; Shortcuts +*#q::QuickLaunch(4) +*#w::QuickLaunch(5) +*#a::QuickLaunch(6) +/* +#q::Taskbar(4) +#w::Taskbar(5) +#a::Taskbar(6) +*/ + +/* +#q:: +hwnd := WinActive("A") +WinGet, mm, MinMax, ahk_id %hwnd% +WinGetPos, wx, wy, ww, wh, ahk_id %hwnd% +MsgBox, %wx%x%wy% -- %ww%x%wh% +if ((mm = 0) && (wx = 0) && (xy = 0) && (ww = A_ScreenWidth) && (wh = A_ScreenHeight)) + WinActivate, ahk_class Progman +return +*/ ;; -> library +QuickLaunch(n) +{ + static start := 56 ; set this to your start menu button width + static width := 24 ; set this to your taskbar button width + static offset := 0 ; don't change this + if (offset = 0) + offset := 15 + else + offset := 0 + x := start + width*(n-1) + offset + + ; Activate taskbar if full-screen + WinGetPos, wx, wy, ww, wh, A + if (wx = 0 and wy = 0 and ww = A_ScreenWidth and wh = A_ScreenHeight) + WinActivate, ahk_class Shell_TrayWnd + + ;DllCall("SwitchToThisWindow", "UInt", WinExist("ahk_class Progman"), "UInt", 1) + tmp := A_CoordModeMouse + CoordMode, Mouse, Screen + MouseGetPos, ox, oy + BlockInput, MouseMove + MouseClick, Left, %x%, %A_ScreenHeight%, 1, 0 + MouseMove, %ox%, %oy%, 0 + BlockInput, MouseMoveOff + CoordMode, Mouse, %tmp% +} + Taskbar(n) { static start := 63 ; set this to your start menu button width @@ -26,6 +87,12 @@ Taskbar(n) offset := 0 x := start + width*(n-1) + offset + ; Activate taskbar if full-screen + WinGetPos, wx, wy, ww, wh, A + if (wx = 0 and wy = 0 and ww = A_ScreenWidth and wh = A_ScreenHeight) + WinActivate, ahk_class Shell_TrayWnd + + ;DllCall("SwitchToThisWindow", "UInt", WinExist("ahk_class Progman"), "UInt", 1) tmp := A_CoordModeMouse CoordMode, Mouse, Screen MouseGetPos, ox, oy |