@@ -191,10 +191,10 @@ def handleInputCompositionEnd(result):
191191 curInputComposition = None
192192 if isinstance (focus ,InputComposition ):
193193 curInputComposition = focus
194- oldSpeechMode = speech .speechMode
195- speech .speechMode = speech .speechMode_off
194+ oldSpeechMode = speech . getState () .speechMode
195+ speech .setSpeechMode ( speech .SpeechMode . off )
196196 eventHandler .executeEvent ("gainFocus" ,focus .parent )
197- speech .speechMode = oldSpeechMode
197+ speech .setSpeechMode ( oldSpeechMode )
198198 elif isinstance (focus .parent ,InputComposition ):
199199 #Candidate list is still up
200200 curInputComposition = focus .parent
@@ -210,10 +210,10 @@ def handleInputCompositionEnd(result):
210210 # Sometimes InputCompositon object is gone
211211 # Correct to container of CandidateItem
212212 newFocus = focus .container
213- oldSpeechMode = speech .speechMode
214- speech .speechMode = speech .speechMode_off
213+ oldSpeechMode = speech . getState () .speechMode
214+ speech .setSpeechMode ( speech .SpeechMode . off )
215215 eventHandler .executeEvent ("gainFocus" ,newFocus )
216- speech .speechMode = oldSpeechMode
216+ speech .setSpeechMode ( oldSpeechMode )
217217
218218 if curInputComposition and not result :
219219 result = curInputComposition .compositionString .lstrip (u'\u3000 ' )
@@ -240,11 +240,11 @@ def handleInputCompositionStart(compositionString,selectionStart,selectionEnd,is
240240 if parent == focus :
241241 parent = focus
242242 curInputComposition = InputComposition (parent = parent )
243- oldSpeechMode = speech .speechMode
244- speech .speechMode = speech .speechMode_off
243+ oldSpeechMode = speech . getState () .speechMode
244+ speech .setSpeechMode ( speech .SpeechMode . off )
245245 eventHandler .executeEvent ("gainFocus" ,curInputComposition )
246246 focus = curInputComposition
247- speech .speechMode = oldSpeechMode
247+ speech .setSpeechMode ( oldSpeechMode )
248248 focus .compositionUpdate (compositionString ,selectionStart ,selectionEnd ,isReading )
249249
250250@WINFUNCTYPE (c_long ,c_wchar_p ,c_int ,c_int ,c_int )
@@ -269,10 +269,10 @@ def handleInputCandidateListUpdate(candidatesString,selectionIndex,inputMethod):
269269 focus = api .getFocusObject ()
270270 if not (0 <= selectionIndex < len (candidateStrings )):
271271 if isinstance (focus ,CandidateItem ):
272- oldSpeechMode = speech .speechMode
273- speech .speechMode = speech .speechMode_off
272+ oldSpeechMode = speech . getState () .speechMode
273+ speech .setSpeechMode ( speech .SpeechMode . off )
274274 eventHandler .executeEvent ("gainFocus" ,focus .parent )
275- speech .speechMode = oldSpeechMode
275+ speech .setSpeechMode ( oldSpeechMode )
276276 return
277277 oldCandidateItemsText = None
278278 if isinstance (focus ,CandidateItem ):
0 commit comments