Skip to content

Commit 0c4a2c4

Browse files
authored
Merge 0012596 into aead5ce
2 parents aead5ce + 0012596 commit 0c4a2c4

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

source/inputCore.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,12 @@ def executeGesture(self, gesture):
492492
queueHandler.queueFunction(queueHandler.eventQueue, speech.speakMessage, gesture.displayName)
493493

494494
gesture.reportExtra()
495-
495+
496+
# Clear memorized last script to avoid getLastScriptRepeatCount return multiple press
497+
# when an unbound gesture is executed between 2 bound gestures.
498+
if not script:
499+
scriptHandler.clearLastScript()
500+
496501
# #2953: if an intercepted command Script (script that sends a gesture) is queued
497502
# then queue all following gestures (that don't have a script) with a fake script so that they remain in order.
498503
if not script and scriptHandler._numIncompleteInterceptedCommandScripts:

source/scriptHandler.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ def getLastScriptRepeatCount():
224224
else:
225225
return _lastScriptCount
226226

227+
def clearLastScript():
228+
global _lastScriptRef, _lastScriptCount
229+
_lastScriptRef = None
230+
_lastScriptCount = 0
231+
227232
def isScriptWaiting():
228233
return bool(_numScriptsQueued)
229234

0 commit comments

Comments
 (0)