-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathAutoHotkey64.ahk
155 lines (112 loc) · 4.26 KB
/
AutoHotkey64.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
#Requires AutoHotkey v2.0
#SingleInstance Force
A_MenuMaskKey := "vkFF"
;#WinActivateForce ; disabled because AHK v2 works better than AHK V1
InstallKeybdHook
InstallMouseHook
; these 2 settings are killing the telegram starter, since the telegram process exists,
; just that it is hidden in the tray, instead of taskbar
; DetectHiddenWindows, On
; SetTitleMatchMode, 2
; Change the icon in taskbar
; Ref: https://github.com/TaranVH/2nd-keyboard/blob/master/INFO_and_PROFILES/system32-shell32_dll.png
; TraySetIcon "shell32.dll", 303 ; changes tray icon to a check mark
; TraySetIcon "shell32.dll", 16 ; change tray icon to a little laptop
; TraySetIcon "shell32.dll", 321 ; change tray icon to a blue star
; TraySetIcon "shell32.dll", 44 ; change tray icon to a yellow star
TraySetIcon("resources/blueStar.ico")
CoordMode("Mouse", "Screen")
; I removed `n and `t from hotstring trigger chars
; https://www.autohotkey.com/docs/v2/Hotstrings.htm#EndChars
#Hotstring EndChars -()[]{}:;'"/\,.?!`s
; Try to make telegram and Feces work better with hotstrings
; 1. Switch all hotstrings from SendInput to SendEvent, otherwise they ignore key delay
; 2. Increase the time between each hotstring hotkey to 10ms
#Hotstring SE K10
;; rest of everything
#Include lib/Tippy.ahk
#Include lib/libdebug.ahk
#Include app_handling.ahk
#Include lib/ReloadScript.ahk
#Include CapsLockToggle.ahk
#Include "Asus Rog Flow X16.ahk"
#Include hotstrings/MarkdownEmoji.ahk
#Include hotstrings/GenericHotstrings.ahk
#Include hotstrings/MarkdownHotstrings.ahk
#Include hotstrings/ResetHotstrings.ahk
#Include *i Private.ahk
#Include "HP so-called Elitebook.ahk"
#Include lib/_JXON.ahk
;-------------------------------------------------
; Handle multiple virtual desktops
CapsLock & D::SendInput "^#{Right}"
CapsLock & A::SendInput "^#{Left}"
;-------------------------------------------------
; CapsLock media keys
CapsLock & Right::SendInput "{Media_Next}"
CapsLock & Left::SendInput "{Media_Prev}"
CapsLock & Up::SendInput "{Media_Play_Pause}"
CapsLock & Down::SendInput "{Media_Play_Pause}"
;-------------------------------------------------
; CapsLock volume
CapsLock & 3::SendInput "{Volume_Down 1}"
CapsLock & 4::SendInput "{Volume_Up 1}"
;-------------------------------------------------
; Mouse buttons Volume
XButton1::SendInput "{Volume_Down 1}"
XBUtton2::SendInput "{Volume_Up 1}"
;------------------------------------------------
; caps lock + space => always on top
CapsLock & SPACE::WinSetAlwaysOnTop(-1, "A")
;------------------------------------------------
; caps lock + 1 => sleep screen
CapsLock & 1 Up::{
Sleep 900 ; if you use this with a hotkey, not sleeping will make it so your keyboard input (lifting your fingers from the keyboard after pressing the hotkey) wakes up the monitor immediately
SendMessage(0x112, 0xF170, 2,, "Program Manager") ; send the monitor into off mode
}
;------------------------------------------------
; CapsLock + P: Toggle between "Power saver" and "Balanced" powers schemes
;CapsLock & P::TogglePowerScheme()
;------------------------------------------------
/*
Note in case future me wants to use `LWin Up::` as a hotkey: DO NOT DO IT, IT WILL NEVER WORK
Things which will break:
- Altsnap (win + double click; win + alt + click to resize)
- Middle click
- Win + E and all other win+key shortcuts
- my sanity
workarounds needed because Touchpad Middle click is made up of these keys:
LWin d
LControl d
LShift d
F22 d
F22 u
LShift u
LControl u
LWin u
MButton d
MButton u
Tippy("thisHotkey " thisHotkey "`nA_PriorHotkey " A_PriorHotkey "`nA_PriorKey " A_PriorKey, 20000)
if(A_PriorKey == "F22") {
Send "{MButton}"
return
}
if(A_PriorKey != "LWin") {
return
}
; end of workarounds
*/
; SC2 Eterrnal Wrath of Eres
; 3 = marine stim
; 4 = tank boost armor
; 1 = moi
CapsLock & m:: {
static toggle := 0
SetTimer(stim, (toggle := !toggle) ? 400 : 0)
}
stim() {
Tippy("stim (caps M)", 3000, 5)
ControlSend("{Blind}{Raw}3tt",, "ahk_exe SC2_x64.exe")
; ControlSend("{Blind}{Raw}4b",, "ahk_exe SC2_x64.exe")
ControlSend("{Blind}{Raw}1h",, "ahk_exe SC2_x64.exe")
}