-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lcuts_a.ahk
302 lines (260 loc) · 7.44 KB
/
Lcuts_a.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#InstallKeybdHook ; to detect pressed keys
#InstallMouseHook ; to detect clicks
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Menu, Tray, Icon, Lcuts.ico ;Load icon
Menu, Tray, Tip, Lcuts ;Change display name
;Set Lock keys permanently
SetNumlockState, AlwaysOn
SetCapsLockState, AlwaysOff
SetScrollLockState, AlwaysOff
Return
^#F8::SwitchStartP("outlook.exe", True)
^#F9::SwitchStartP("slack.exe")
^#F10::SwitchStartP("C:\Program Files\Altap Salamander\salamand.exe")
^#F11::SwitchStartP("excel.exe")
^#F12::SwitchStartP("chrome.exe")
; XButton1::
; ;^#left
; Send {Ctrl down}{LWin down}{Left down}
; Sleep 50
; Send {Left up}{LWin up}{Ctrl up}
; Return
; XButton2::
; ;^#right
; Send {Ctrl down}{LWin down}{Right down}
; Sleep 50
; Send {Right up}{LWin up}{Ctrl up}
; Return
;===================
;= WORD =
;===================
;NumpadDiv::SwitchStartP("winword.exe")
;===================
;= EXCEL =
;===================
;NumpadMult::SwitchStartP("excel.exe")
;===================
;= ALISTA =
;===================
;NumpadAdd::Run, "C:\Program Files\internet explorer\iexplore.exe" "http://msdn.microsoft.com/en-us/library/aa394372.aspx"
;===================
;= WINDOW TITLE =
;===================
;Shows the title of the window being hovered on a traytip
; NumpadSub::
; {
; MouseGetPos, , , id, control ;Gets the id of the window being hovered
; WinGetTitle, Title, ahk_id %id% ;Get the title of the window from its id
; Traytip, Window, %Title%, 0.5, 1
; Return
; }
;===================
;= MINIMIZE =
;===================
;Minimizes the window being hovered
; NumpadDot::
; {
; MouseGetPos, , , id, control ;Gets the id of the window being hovered
; WinGetTitle, Title, ahk_id %id% ;Get the title of the window from its id
; WinMinimize, %Title%
; Return
; }
;===================
;= SALAMANDER =
;===================
;Numpad0::SwitchStartP("C:\Program Files\Altap Salamander\salamand.exe")
;===================
;= SKYPE =
;===================
;Numpad1::SwitchStartP("lync.exe")
;===================
;= CHROME =
;===================
;Numpad2::SwitchStartP("chrome.exe")
;===================
;= TASK MANAGER =
;===================
;Numpad3::SwitchStartP("taskmgr.exe")
;===================
;= CALCULATOR =
;===================
;Numpad4::SwitchStartP("calc.exe")
;launch calculator and paste clipboard
; ^Numpad4::
; {
; SwitchStartPW("calc.exe", "Calculator", True)
; Send, ^v
; Return
; }
;===================
;= HISTORY =
;===================
Numpad5::KeyHistory
;===================
;= HELP =
;===================
;^Numpad5::DisplayHelp()
;===================
;= AEC =
;===================
;Numpad6::Run, "C:\Program Files\internet explorer\iexplore.exe" "http://msdn.microsoft.com/en-us/library/aa394372.aspx"
;Launches Notepad
;Numpad7::SwitchStartP("notepad.exe")
;===================
;= OUTLOOK =
;===================
;Activate Outlook and switch to mail
; Numpad8::
; {
; SwitchStartP("outlook.exe", True)
; Send, ^&
; Return
; }
;Activate Outlook and search from clipboard
; ^Numpad8::
; {
; Send, ^c
; SwitchStartP("outlook.exe", True)
; Send, ^e^v{Enter}
; Return
; }
;Activate Outlook and create new mail
; #Numpad8::
; {
; SwitchStartP("outlook.exe", True)
; Send, ^&
; Sleep, 1000
; Send, ^n
; Return
; }
;===================
;= CLEARQUEST =
;===================
;Numpad9::Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "http://msdn.microsoft.com/en-us/library/aa394372.aspx"
;===================
;= SNIPPING =
;===================
; PrintScreen::
; {
; SwitchStartP("SnippingTool.exe", True)
; Send, !n
; Return
; }
;===================
;= LOCK PC =
;===================
;Pause::SendMessage, 0x112, 0xF170, 2,, Program Manager
;===================
;= CLOSE WINDOW =
;===================
;ScrollLock::!F4
;Right windows key
;Middle button click to task view
;RWin::Send, #{Tab}
;===================
;= MOUSE =
;===================
;Control + middle mouse button: switch mouse sensitivity
;MButton::SwitchMouseSensitivity()
;===================
;= CapsLock =
;===================
;= DITTO =
;^!v ;ditto paste text
;#< ;ditto paste position 2
; Appskey::Send, {Blind}^#ù ;Ditto
; CapsLock & f:: ;Google search
; {
; Send, {Blind}^c
; Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" http://www.google.com/search?q="%clipboard%"
; Return
; }
;= Window dragging =
; CapsLock & LButton::
; {
; CoordMode, Mouse ; Switch to screen/absolute coordinates.
; MouseGetPos, EWD_MouseStartX, EWD_MouseStartY, EWD_MouseWin
; WinGetPos, EWD_OriginalPosX, EWD_OriginalPosY,,, ahk_id %EWD_MouseWin%
; WinGet, EWD_WinState, MinMax, ahk_id %EWD_MouseWin%
; if EWD_WinState = 0 ; Only if the window isn't maximized
; SetTimer, EWD_WatchMouse, 10 ; Track the mouse as the user drags it.
; Return
; EWD_WatchMouse:
; GetKeyState, EWD_LButtonState, LButton, P
; if EWD_LButtonState = U ; Button has been released, so drag is complete.
; {
; SetTimer, EWD_WatchMouse, Off
; Return
; }
; GetKeyState, EWD_EscapeState, Escape, P
; if EWD_EscapeState = D ; Escape has been pressed, so drag is cancelled.
; {
; SetTimer, EWD_WatchMouse, Off
; WinMove, ahk_id %EWD_MouseWin%,, %EWD_OriginalPosX%, %EWD_OriginalPosY%
; Return
; }
;Otherwise, reposition the window to match the change in mouse coordinates
;caused by the user having dragged the mouse:
; CoordMode, Mouse
; MouseGetPos, EWD_MouseX, EWD_MouseY
; WinGetPos, EWD_WinX, EWD_WinY,,, ahk_id %EWD_MouseWin%
; SetWinDelay, -1 ; Makes the below move faster/smoother.
; WinMove, ahk_id %EWD_MouseWin%,, EWD_WinX + EWD_MouseX - EWD_MouseStartX, EWD_WinY + EWD_MouseY - EWD_MouseStartY
; EWD_MouseStartX := EWD_MouseX ; Update for the next timer-call to this subroutine.
; EWD_MouseStartY := EWD_MouseY
; Return
; }
;///////////////////
;/ CapsLock /
;///////////////////
SwitchStartP(sProgramToStart, bWait:=False)
{
sSearchWindow := "ahk_exe " . sProgramToStart
SwitchStartPW(sProgramToStart, sSearchWindow, bWait)
}
SwitchStartPW(sProgramToStart, sSearchWindow, bWait:=False)
{
if WinExist(sSearchWindow)
{
WinActivate, %sSearchWindow%
;Traytip, Window, Switched to %sProgramToStart%, 0.5, 1
}
else
{
Run, %sProgramToStart%
;Traytip, Window, Launched %sProgramToStart%, 0.5, 1
}
if(bWait = True)
WinWaitActive, %sSearchWindow%
}
SwitchMouseSensitivity()
{
static iSensitivity := 20
sSensitivity = low
if(iSensitivity = 20)
iSensitivity = 3
else
{
iSensitivity = 20
sSensitivity = high
}
DllCall("SystemParametersInfo", Int,113, Int,0, UInt,iSensitivity, Int,2)
Traytip, Mouse, Sensitivity set to %sSensitivity%, 0.5, 1
}
DisplayHelp()
{
static bHelp := False
if(bHelp = False)
{
bHelp := True
SplashImage, Lcuts.png, b1 fs18, Lcuts: cutting the work :)
}
else
{
bHelp := False
SplashImage, Off
}
}