Skip to content

Commit a1feed9

Browse files
committed
Fix #30
Modified script_navigate to allow "None" as a value for "gesture". Test that and skip navigation if the value is None. Add a call from 'interactWithMathMl' with that value.
1 parent fc77a0e commit a1feed9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

NVDA-addon/addon/globalPlugins/MathCAT/MathCAT.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,12 @@ def getScript(self, gesture):
152152

153153
def script_navigate(self, gesture):
154154
# log.info("***MathCAT script_navigate")
155-
modNames = gesture.modifierNames
156155
try:
157-
text = libmathcat.DoNavigateKeyPress(gesture.vkCode,
158-
"shift" in modNames, "control" in modNames, "alt" in modNames, False)
159-
speech.speak(ConvertSSMLTextForNVDA(text, self.provider._language))
156+
if gesture != None:
157+
modNames = gesture.modifierNames
158+
text = libmathcat.DoNavigateKeyPress(gesture.vkCode,
159+
"shift" in modNames, "control" in modNames, "alt" in modNames, False)
160+
speech.speak(ConvertSSMLTextForNVDA(text, self.provider._language))
160161

161162
# update the braille to reflect the nav position (might be excess code, but it works)
162163
nav_node = libmathcat.GetNavigationMathMLId()
@@ -295,6 +296,7 @@ def getBrailleForMathMl(self, mathml):
295296

296297
def interactWithMathMl(self, mathMl):
297298
MathCATInteraction(provider=self, mathMl=mathMl).setFocus()
299+
MathCATInteraction(provider=self, mathMl=mathMl).script_navigate(None)
298300

299301
def _setSpeechLanguage(self, mathMl):
300302
lang = mathPres.getLanguageFromMath(mathMl)

0 commit comments

Comments
 (0)