add command for temp disable speech

This commit is contained in:
chrys 2016-12-18 23:23:04 +01:00
parent 735167b057
commit 4737b828cd
6 changed files with 62 additions and 1 deletions

View File

@ -70,6 +70,7 @@ KEY_KPPLUS=last_incoming
KEY_FENRIR,KEY_F2=toggle_braille KEY_FENRIR,KEY_F2=toggle_braille
KEY_FENRIR,KEY_F3=toggle_sound KEY_FENRIR,KEY_F3=toggle_sound
KEY_FENRIR,KEY_F4=toggle_speech KEY_FENRIR,KEY_F4=toggle_speech
#=temp_disable_speech
KEY_FENRIR,KEY_CTRL,KEY_P=toggle_punctuation_level KEY_FENRIR,KEY_CTRL,KEY_P=toggle_punctuation_level
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
KEY_FENRIR,KEY_BACKSLASH=toggle_output KEY_FENRIR,KEY_BACKSLASH=toggle_output

View File

@ -70,6 +70,7 @@ KEY_FENRIR,KEY_SEMICOLON=last_incoming
KEY_FENRIR,KEY_F2=toggle_braille KEY_FENRIR,KEY_F2=toggle_braille
KEY_FENRIR,KEY_F3=toggle_sound KEY_FENRIR,KEY_F3=toggle_sound
KEY_FENRIR,KEY_F4=toggle_speech KEY_FENRIR,KEY_F4=toggle_speech
#=temp_disable_speech
KEY_FENRIR,KEY_SHIFT,KEY_CTRL,KEY_P=toggle_punctuation_level KEY_FENRIR,KEY_SHIFT,KEY_CTRL,KEY_P=toggle_punctuation_level
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
KEY_FENRIR,KEY_SHIFT,KEY_ENTER=toggle_output KEY_FENRIR,KEY_SHIFT,KEY_ENTER=toggle_output

View File

@ -69,7 +69,8 @@ KEY_FENRIR,KEY_KPSLASH=set_window_application
KEY_KPPLUS=last_incoming KEY_KPPLUS=last_incoming
KEY_FENRIR,KEY_F2=toggle_braille KEY_FENRIR,KEY_F2=toggle_braille
KEY_FENRIR,KEY_F3=toggle_sound KEY_FENRIR,KEY_F3=toggle_sound
KEY_FENRIR,KEY_F4=toggle_speech #=toggle_speech
KEY_FENRIR,KEY_F4=temp_disable_speech
KEY_FENRIR,KEY_CTRL,KEY_P=toggle_punctuation_level KEY_FENRIR,KEY_CTRL,KEY_P=toggle_punctuation_level
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
KEY_FENRIR,KEY_BACKSLASH=toggle_output KEY_FENRIR,KEY_BACKSLASH=toggle_output

View File

@ -0,0 +1,26 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from core import debug
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return 'disables speech until next keypress'
def run(self):
if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled'):
self.env['runtime']['outputManager'].presentText("speech temporary disabled", soundIcon='SpeechOff', interrupt=True)
self.env['commandBuffer']['enableSpeechOnKeypress'] = True
self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled')))
def setCallback(self, callback):
pass

View File

@ -0,0 +1,31 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from core import debug
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return 'disables speech until next keypress'
def run(self):
if self.env['runtime']['inputManager'].noKeyPressed():
return
if len(self.env['input']['prevInput']) >0:
return
if not self.env['commandBuffer']['enableSpeechOnKeypress']:
return
self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(self.env['commandBuffer']['enableSpeechOnKeypress']))
self.env['commandBuffer']['enableSpeechOnKeypress'] = False
self.env['runtime']['outputManager'].presentText("speech enabled", soundIcon='SpeechOn', interrupt=True)
def setCallback(self, callback):
pass

View File

@ -11,6 +11,7 @@ import time
# used as shared memory between commands # used as shared memory between commands
# use this in your own commands # use this in your own commands
commandBuffer = { commandBuffer = {
'enableSpeechOnKeypress': False,
'genericList':[], 'genericList':[],
'genericListSource':'', 'genericListSource':'',
'genericListSelection': 0, 'genericListSelection': 0,