-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkeynav.ahk
150 lines (126 loc) · 1.88 KB
/
keynav.ahk
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
Gui, horizontal:-Caption +E0x20 +ToolWindow +AlwaysOnTop +LastFound
WinSet, Transparent, 100
Gui, vertical:-Caption +E0x20 +ToolWindow +AlwaysOnTop +LastFound
WinSet, Transparent, 100
Gui, horizontal:Color, Blue
Gui, vertical:Color, Blue
Gui, box:Color, Red
CoordMode, Mouse, Screen
active := false
dragging := false
^;::
x0 := 0
x1 := A_screenWidth
y0 := 0
y1 := A_screenHeight
active := true
Gosub, Redraw
return
#If active
`;::
active := false
if dragging {
Click, Up
}
dragging := false
Gui, horizontal: Hide
Gui, vertical: Hide
return
h::
x1 := (x0 + x1) / 2
Gosub, Redraw
return
j::
y0 := (y0 + y1) / 2
Gosub, Redraw
return
k::
y1 := (y0 + y1) / 2
Gosub, Redraw
return
l::
x0 := (x0 + x1) / 2
Gosub, Redraw
return
w::
xi := Floor(x)
yi := Floor(y)
DllCall("SetCursorPos", int, xi, int, yi)
return
1::
MouseClick
return
3::
Click, Right
return
4::
Click, WheelUp
return
5::
Click, WheelDown
return
<+k::
increment := (y1 - y0)
y0 := y0 - increment
y1 := y1 - increment
Gosub, Redraw
return
<+j::
increment := (y1 - y0)
y0 := y0 + increment
y1 := y1 + increment
Gosub, Redraw
return
<+h::
increment := (x1 - x0)
x0 := x0 - increment
x1 := x1 - increment
Gosub, Redraw
return
<+l::
increment := (x1 - x0)
x0 := x0 + increment
x1 := x1 + increment
Gosub, Redraw
return
c::
MouseGetPos, xpos, ypos
x0 := xpos - 100
x1 := xpos + 100
y0 := ypos - 100
y1 := ypos + 100
Gosub, Redraw
return
x::
midx := (x0 + x1) / 2
x0 := midx - 100
x1 := midx + 100
ypos := (y0 + y1) / 2
y0 := ypos - 100
y1 := ypos + 100
Gosub, Redraw
return
d::
Click, Down
dragging := true
return
o::
SysGet, Mon, Monitor, 1
x0 := MonLeft
x1 := MonRight
y0 := MonTop
y1 := MonBottom
Gosub, Redraw
return
#IfWinActive
Redraw:
x := (x0 + x1) / 2
y := (y0 + y1) / 2
w := (x1 - x0) / 2
h := (y1 - y0) / 2
Gui, horizontal:Show, x%x% y%y0% NA h%h% w1
Gui, vertical:Show, x%x0% y%y% NA h1 w%w%
if dragging {
MouseMove, %x%, %y%
}
return