-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKeyboardExtensionsV2.ahk
190 lines (176 loc) · 4.04 KB
/
KeyboardExtensionsV2.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
#MaxThreadsPerHotkey 2
Persistent
SetNumLockState("AlwaysOn")
; CapsLock is remapped (in WinRegistry) to F17 with the tool SharpKeys !
#HotIf GetKeyState("F17", "P") ; For all following functions CapsLock is necessary as activator
Space:: SetCapsLockState(!GetKeyState("CapsLock", "T")) ; Toggle the real CapsLockState with CapslockKey + Space
; write german (annoying) umlauts when US layout is used with any keyboard
a:: Send("ä")
o:: Send("ö")
u:: Send("ü")
e:: Send("€")
+a:: Send("Ä")
+o:: Send("Ö")
+u:: Send("Ü")
; write german (annoying) umlauts when US layout is used with an german keyboard (keys above also working)
':: Send("ä") ;easier on german layout
SC027:: Send("ö") ;easier on german layout
[:: Send("ü") ;easier on german layout
s:: Send("ß") ;CapsLock+s = CapsLock+s, Eszett
+':: Send("Ä") ;easier on german layout
+SC027:: Send("Ö") ;easier on german layout
+[:: Send("Ü") ;easier on german layout
-:: Send("ß") ;easier on german layout
;for keyboards with missing Pause key
p:: Send("{Pause}")
; use the program spyxx to find a windows control message, then you can assign shortcuts to it.
; Example:
; +t::
; PostMessage, 0x0111, 0x00001303, 0x00000000,,DOSBox-X ; Turbo
; RETURN
; always useful
Right:: Send("{Volume_Up}")
Left:: Send("{Volume_Down}")
^t::
{
CurrentDateTime := FormatTime(, "dd.MM.yyyy")
SendInput(CurrentDateTime " mailaddress")
RETURN
}
; Convert Clip to upper
^PgUp::
{
A_Clipboard := StrUpper(A_Clipboard)
Send(A_Clipboard)
RETURN
}
; Convert Clip to lower
^PgDn::
{
A_Clipboard := StrLower(A_Clipboard)
Send(A_Clipboard)
RETURN
}
; Reverse Clip
^r::
{
strvar := A_Clipboard
DllCall("msvcrt.dll\_wcsrev", "UPtr", StrPtr(strvar), "CDecl")
Send(strvar)
RETURN
}
; Clip to KeyboardKeys (useful on fields that prevent direct insert from Clip)
^v:: Send("{Raw}" A_Clipboard) ;
; Strikethrough Clip
^F11::
{
str := A_Clipboard
out := ""
Loop strlen(str)
out .= SubStr(str, (A_Index) < 1 ? (A_Index) - 1 : (A_Index), 1) Chr(0x336)
Send(out)
RETURN
}
; Column ClipBoard Insert
^F12::
{
Send("{Down}")
length := StrLen(A_Clipboard)
Send("{Left " length "}")
Send("{Raw}" A_Clipboard)
RETURN
}
;Numpad Keyboard Mouse
SC04F:: MouseMove(-1, 1, 0, "R") ; Numpad1 key down left
SC050:: MouseMove(0, 1, 0, "R") ; Numpad2 key down
SC051:: MouseMove(1, 1, 0, "R") ; Numpad3 key down right
SC04B:: MouseMove(-1, 0, 0, "R") ; Numpad4 key left
SC04C:: Send("{LButton}") ; Numpad5 LButton
SC053:: Send("{RButton}") ; Numpad. RButton
SC04D:: MouseMove(1, 0, 0, "R") ; Numpad6 key right
SC047:: MouseMove(-1, -1, 0, "R") ; Numpad7 key up left
SC048:: MouseMove(0, -1, 0, "R") ; Numpad8 key up
SC049:: MouseMove(1, -1, 0, "R") ; Numpad9 key up right
toggle := 0
SC052::
{
global
(toggle := !toggle) ? toggleon() : toggleoff() ; Numpad0 Toggle LButton
}
toggleon()
{
Send("{LButton Down}")
ToolTip("Left Button Down`ris active", 20, 20, 1)
}
toggleoff()
{
Send("{LButton Up}")
ToolTip(, , , 1)
}
Fire := 0
LButton::
{
global
Send("{LButton}")
if not KeyWait('LButton', 'T0.25')
{
Fire := !Fire
While Fire
{
Send("{LButton}")
Sleep(1)
}
}
Fire := 0
RETURN
}
awake := 0
^w::
{
global
awake := !awake
ToolTip "Awake is " awake, 20, 20, 2
SetTimer () => ToolTip(, , , 2), -3000
While awake
{
MouseMove(1, 0, 0, "R")
MouseMove(-1, 0, 0, "R")
Sleep(170000)
}
RETURN
}
#HotIf
;make Mouse Button 4 & 5 useful
XButton2:: Send("#v")
XButton1::
{
startTime := A_TickCount
while GetKeyState('XButton1', 'P')
{
if (A_TickCount - startTime > 250)
{
Send("#{TAB}")
return
}
Sleep(10)
}
Send("!{TAB}")
RETURN
}
; Win11 Greenshot Fixes (adjust Greenshot Preferences, also!)
+PrintScreen::
{
Send "{Shift Down}{F22}{Shift Up}" ; Capture last region
RETURN
}
!PrintScreen::
{
Send "{Alt Down}{F22}{Alt Up}" ; Capture window
RETURN
}
^PrintScreen::
{
Send "{Ctrl Down}{F22}{Ctrl Up}" ; Capture full screen
RETURN
}
*PrintScreen:: Send "{F22}" ; Capture region