-
Notifications
You must be signed in to change notification settings - Fork 5
/
Hotkeys.ahk
115 lines (99 loc) · 1.9 KB
/
Hotkeys.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
#SingleInstance Force
#Persistent
#NoTrayIcon
#InstallKeybdHook
#InstallMouseHook
#Include *i %A_ScriptDir%\Includes\StartUp.ahk
#Include %A_ScriptDir%\Includes\FuncFunctions.ahk
Return
SelectModeTimer:
SetTimer, SelectModeTimer, Off
If (DetectContextMenu() = 1) OR (WinExist("ahk_class Chrome_WidgetWin_2") AND WinActive("ahk_exe chrome.exe"))
{
SetTimer, SelectModeTimer, On
}
else
{
SelectMode := 0
}
Return
~LWin::
if !Triggered
{
TimeNow := A_TickCount
Triggered := 1
}
Return
~LCtrl::
if !Triggered
{
TimeNow := A_TickCount
Triggered := 1
}
Return
~LShift::
if !Triggered
{
TimeNow := A_TickCount
Triggered := 1
}
Return
~LWin Up::
if (A_PriorKey = "Lwin") and (TimeNow > 0) and (A_TickCount - TimeNow < 250) {
Run, explorer.exe
WinWaitActive, ahk_class CabinetWClass, , 2
Send {LCtrl Down}{LShift Down}6{LShift Up}{LCtrl Up} ; Set the view type to details
Send {F3} ; Set the search bar to have focus
}
Triggered := 0
Return
~LCtrl Up::
if (A_PriorKey = "LControl") and (TimeNow > 0) and (A_TickCount - TimeNow < 250) {
Run, % DefaultBrowser()
}
Triggered := 0
Return
~LShift Up::
if (A_PriorKey = "LShift") and (TimeNow > 0) and (A_TickCount - TimeNow < 250) {
If (DetectContextMenu() = 1) OR (WinExist("ahk_class Chrome_WidgetWin_2") AND WinActive("ahk_exe chrome.exe"))
Send {LAlt}
Else
Send {AppsKey} ; Context menu
}
Triggered := 0
Return
*~LButton::
*~RButton::
*~MButton::
*~XButton1::
*~XButton2::
*~WheelDown::
*~WheelUp::
*~WheelLeft::
*~WheelRight::
TimeNow := 0
Return
#If (DetectContextMenu() = 1) OR (WinExist("ahk_class Chrome_WidgetWin_2") AND WinActive("ahk_exe chrome.exe"))
WheelUp::
Send, {Up}
SelectMode := 1
SetTimer, SelectModeTimer, -15
Return
WheelDown::
Send, {Down}
SelectMode := 1
SetTimer, SelectModeTimer, -15
Return
$LButton::
If (SelectMode = 1)
Send, {Enter}
Else
Send, {LButton}
Return
$RButton::
If (SelectMode = 1)
Send, {Esc}
Else
Send, {RButton}
Return
#If