~onboard/onboard/1.1

« back to all changes in this revision

Viewing changes to Onboard/WordSuggestions.py

  • Committer: marmuta
  • Date: 2015-08-20 13:05:19 UTC
  • mto: This revision was merged to the branch mainline in revision 1972.
  • Revision ID: marmvta@gmail.com-20150820130519-ceidlz2iqkgewuiz
Merge trunk rev. 1972: Hide pauses due to auto-saving large language models by waiting until the keyboard becomes idle.

Show diffs side-by-side

added added

removed removed

Lines of Context:
236
236
    def get_spellchecker_dicts(self):
237
237
        return self._spell_checker.get_supported_dict_ids()
238
238
 
 
239
    def on_activity_detected(self):
 
240
        """
 
241
        User interacted with the keyboard.
 
242
        """
 
243
        if self._wpengine:
 
244
            self._wpengine.postpone_autosave()
 
245
 
 
246
    def on_before_key_press(self, key):
 
247
        if not key.is_modifier() and not key.is_button():
 
248
            self._punctuator.on_before_press(key)
 
249
        self.text_context.on_onboard_typing(key, self.get_mod_mask())
 
250
 
 
251
    def on_after_key_release(self, key):
 
252
        self._punctuator.on_after_release(key)
 
253
        if not key.is_correction_key():
 
254
            self.expand_corrections(False)
 
255
 
239
256
    def send_key_up(self, key, button, event_type):
240
257
        key_type = key.type
241
258
        if key_type == KeyCommon.CORRECTION_TYPE:
250
267
                        KeyCommon.MACRO_TYPE]:
251
268
            self.text_context.on_onboard_typing(key, self.get_mod_mask())
252
269
 
253
 
    def on_before_key_press(self, key):
254
 
        if not key.is_modifier() and not key.is_button():
255
 
            self._punctuator.on_before_press(key)
256
 
        self.text_context.on_onboard_typing(key, self.get_mod_mask())
257
 
 
258
 
    def on_after_key_release(self, key):
259
 
        self._punctuator.on_after_release(key)
260
 
        if not key.is_correction_key():
261
 
            self.expand_corrections(False)
262
 
 
263
270
    def enter_caps_mode(self):
264
271
        """
265
272
        Do what has to be done so that the next pressed