File tree 1 file changed +9
-3
lines changed 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,12 @@ def remove_onetime_cooldown():
91
91
onetime_cooldown = not onetime_cooldown
92
92
93
93
94
+ def press_backspace ():
95
+ global controller
96
+ controller .press (Key .backspace )
97
+ controller .release (Key .backspace )
98
+
99
+
94
100
def on_key_press (key ):
95
101
if hasattr (key , "char" ):
96
102
key = str (key .char )
@@ -103,15 +109,15 @@ def on_key_press(key):
103
109
global started
104
110
global exited
105
111
if key == settings ["hotkey" ]:
106
- controller . press ( Key . backspace )
112
+ press_backspace ( )
107
113
started = not started
108
114
if started :
109
115
print ("Started." )
110
116
init_typer ()
111
117
else :
112
118
print ("Stopped." )
113
119
if key == settings ["exitkey" ]:
114
- controller . press ( Key . backspace )
120
+ press_backspace ( )
115
121
print ("Exited." )
116
122
started = False
117
123
exited = True
@@ -120,7 +126,7 @@ def on_key_press(key):
120
126
global onetime_cooldown
121
127
global onetime_queue
122
128
if key == settings ["onetime" ]["hotkey" ]:
123
- controller . press ( Key . backspace )
129
+ press_backspace ( )
124
130
print ("Started onetime cmds." )
125
131
cmds = settings ["onetime" ]["commands" ]
126
132
for i in cmds :
You can’t perform that action at this time.
0 commit comments