File tree 1 file changed +22
-2
lines changed
1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -70,14 +70,34 @@ class KeyManager {
70
70
71
71
this.HoldWatcherFn := this.HoldWatcher.Bind(this)
72
72
this.TapWatcherFn := this.TapWatcher.Bind(this)
73
+ this.JoyReleaseFn := this.JoyButtonRelease.Bind(this)
74
+ this.JoyWatcherFn := this.JoyButtonWatcher.Bind(this)
73
75
this.DeclareHotkeys()
74
76
}
75
77
76
78
DeclareHotkeys (){
77
79
fn := this.KeyEvent.Bind(this, 1 )
78
80
hotkey , % this.prefixes this.keyName, % fn
79
- fn := this.KeyEvent.Bind(this, 0 )
80
- hotkey , % this.prefixes this.keyName " up" , % fn
81
+ if (SubStr (this.keyName, 2 , 3 ) = " joy" ){
82
+ fn := this.JoyReleaseFn
83
+ hotkey , % this.keyName " up" , % fn
84
+ } else {
85
+ fn := this.KeyEvent.Bind(this, 0 )
86
+ hotkey , % this.prefixes this.keyName " up" , % fn
87
+ }
88
+ }
89
+
90
+ JoyButtonRelease (){
91
+ fn := this.JoyWatcherFn
92
+ SetTimer , % fn, 10
93
+ }
94
+
95
+ JoyButtonWatcher (){
96
+ if (! GetKeyState (this.keyName)){
97
+ fn := this.JoyWatcherFn
98
+ SetTimer , % fn, Off
99
+ this.KeyEvent(0 )
100
+ }
81
101
}
82
102
83
103
KeyEvent (state ){
You can’t perform that action at this time.
0 commit comments