aboutsummaryrefslogtreecommitdiff
path: root/tt.windowselect.ahk
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-04-19 19:16:05 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-04-19 19:16:05 +0200
commitd4f1caaab6439b8b1b20244cf5a005b8d4616f58 (patch)
treedef43b6c3f3e6b0d2edb97a5a318ec8665573e91 /tt.windowselect.ahk
parent54a48fd17e1d776d42ac4af36cc11365a9afbdc4 (diff)
downloadahk-d4f1caaab6439b8b1b20244cf5a005b8d4616f58.tar.gz
Re-write and re-add tt.windowselect.ahk
This Windows 7 variant just clicks the relevant taskbar buttons. I made this in order to circumvent an issue I had with 7+ Taskbar Tweaker, where an option that changes the left-click behavior of taskbar buttons didn't apply when using the shortcut keys (Win-n).
Diffstat (limited to 'tt.windowselect.ahk')
-rw-r--r--tt.windowselect.ahk35
1 files changed, 35 insertions, 0 deletions
diff --git a/tt.windowselect.ahk b/tt.windowselect.ahk
new file mode 100644
index 0000000..0f975b9
--- /dev/null
+++ b/tt.windowselect.ahk
@@ -0,0 +1,35 @@
+;; Select window by number ----------------------------------------------------
+
+;; -> body
+
+#1::Taskbar(1)
+#2::Taskbar(2)
+#3::Taskbar(3)
+#4::Taskbar(4)
+#5::Taskbar(5)
+#6::Taskbar(6)
+#7::Taskbar(7)
+#8::Taskbar(8)
+#9::Taskbar(9)
+#0::Taskbar(10)
+
+;; -> library
+
+Taskbar(n)
+{
+ static start := 63 ; set this to your start menu button width
+ static width := 63 ; set this to your taskbar button width
+ static offset := 0 ; don't change this
+ if (offset = 0)
+ offset := 10
+ else
+ offset := 0
+ x := start + width*(n-1) + offset
+
+ tmp := A_CoordModeMouse
+ CoordMode, Mouse, Screen
+ MouseGetPos, ox, oy
+ MouseClick, Left, %x%, %A_ScreenHeight%, 1, 0
+ MouseMove, %ox%, %oy%, 0
+ CoordMode, Mouse, %tmp%
+}