aboutsummaryrefslogtreecommitdiff
path: root/tt.windowselect.ahk
blob: 889c735ce9485dc51597515c80ce1df2f45ee27e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
;; 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 := 15
	else
		offset := 0
	x := start + width*(n-1) + offset
	
	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%
}