Fix for last script count when an unbound gesture is executed between two identical bound gestures#11767
Conversation
…wo identical bound gestures.
See test results for failed build of commit 0c4a2c4431 |
| # Clear memorized last script to avoid getLastScriptRepeatCount detect a repeat | ||
| # in case an unbound gesture is executed between two identical bound gestures. | ||
| if not script: | ||
| scriptHandler.clearLastScript() |
There was a problem hiding this comment.
This needs to be queued to the main thread.
E.g.
queueHandler.queueFunction,queueHandler.eventQueue, scriptHandler.clearLastScript)
Reason: This code is run in the input thread, and there is a chance that those variables will be cleared before a previous script is pulled from the queue in the main thread and executed.
I would also consider moving this code into an else block directly under the call to queueScript at the end of this function.
There was a problem hiding this comment.
This needs to be queued to the main thread.
Done. Thanks.
I would also consider moving this code into an else block directly under the call to queueScript at the end of this function.
As you suggested, I have moved the call to clearLastScript at the end of the function. Actually, clearing last script variables before handling intercepted command Script case would maybe have caused wrong setting of the variable keeping track of the last executed script.
I have also moved the raise NoInputGestureAction in the else branch since the call to clearLastScript and the raise statement belong to the same execution branch.
|
Thanks @michaelDCurran for this review. I have addressed all comments. Let me know if there is something remaining to be done. |
Link to issue number:
Fixes #11388
Summary of the issue:
scriptHandler.getLastScriptRepeatCount is used to detect double/triple press.
However, in the case described in #11388, the user presses 3 keystrokes quickly:
The first and the third are bound to a script but not the second.
Since the second keystroke is not bound to a script, NVDA does not detect it and thus consider that the 2 keystrokes of NVDA+UpArrow is a double key press.
Description of how this pull request fixes the issue:
When a gesture that is not bound to a script is executed, clear the last script ref and count so that the subsequent script is not detected as a repeat.
Testing performed:
Known issues with pull request:
None
Notes for reviewer
I would especially like to have the following points confirmed:
Change log entry:
Section: Bug fixes
NVDA no longer detects repeated script gesture inappropriately when executing quickly some sequences of gestures. (#11388)