-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshift_parenth.ahk
70 lines (68 loc) · 1.51 KB
/
shift_parenth.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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
// #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.
~LShift::
KeyWait, LShift
If (A_TimeSinceThisHotkey < 250 and A_PriorKey = "LShift") {
Send, (
}
if quickclicks > 0 ; SetTimer already started, so log keypress instead
{
quickclicks += 1
Return
}
quickclicks = 1
SetTimer, TheKey, 500
Return
TheKey:
SetTimer, TheKey, off
if quickclicks = 2 ;
{
send, {BackSpace}{BackSpace}
send, [
}
if quickclicks = 3 ;
{
send, {BackSpace}{BackSpace}{BackSpace}
send, {{}
}
if quickclicks = 4 ;
{
send, {BackSpace}{BackSpace}{BackSpace}{BackSpace}
send, {<}
}
quickclicks = 0
return
~RShift::
KeyWait, RShift
If (A_TimeSinceThisHotkey < 250 and A_PriorKey = "RShift") {
Send, )
}
if rquickclicks > 0 ; SetTimer already started, so log keypress instead
{
rquickclicks += 1
Return
}
rquickclicks = 1
SetTimer, rTheKey, 500
Return
rTheKey:
SetTimer, rTheKey, off
if rquickclicks = 2 ;
{
send, {BackSpace}{BackSpace}
send, ]
}
if rquickclicks = 3 ;
{
send, {BackSpace}{BackSpace}{BackSpace}
send, {}}
}
if rquickclicks = 4 ;
{
send, {BackSpace}{BackSpace}{BackSpace}{BackSpace}
send, {>}
}
rquickclicks = 0
return