add command for temp disable speech
This commit is contained in:
parent
735167b057
commit
4737b828cd
@ -70,6 +70,7 @@ KEY_KPPLUS=last_incoming
|
||||
KEY_FENRIR,KEY_F2=toggle_braille
|
||||
KEY_FENRIR,KEY_F3=toggle_sound
|
||||
KEY_FENRIR,KEY_F4=toggle_speech
|
||||
#=temp_disable_speech
|
||||
KEY_FENRIR,KEY_CTRL,KEY_P=toggle_punctuation_level
|
||||
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
|
||||
KEY_FENRIR,KEY_BACKSLASH=toggle_output
|
||||
|
@ -70,6 +70,7 @@ KEY_FENRIR,KEY_SEMICOLON=last_incoming
|
||||
KEY_FENRIR,KEY_F2=toggle_braille
|
||||
KEY_FENRIR,KEY_F3=toggle_sound
|
||||
KEY_FENRIR,KEY_F4=toggle_speech
|
||||
#=temp_disable_speech
|
||||
KEY_FENRIR,KEY_SHIFT,KEY_CTRL,KEY_P=toggle_punctuation_level
|
||||
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
|
||||
KEY_FENRIR,KEY_SHIFT,KEY_ENTER=toggle_output
|
||||
|
@ -69,7 +69,8 @@ KEY_FENRIR,KEY_KPSLASH=set_window_application
|
||||
KEY_KPPLUS=last_incoming
|
||||
KEY_FENRIR,KEY_F2=toggle_braille
|
||||
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_RIGHTBRACE=toggle_auto_spell_check
|
||||
KEY_FENRIR,KEY_BACKSLASH=toggle_output
|
||||
|
26
src/fenrir/commands/commands/temp_disable_speech.py
Normal file
26
src/fenrir/commands/commands/temp_disable_speech.py
Normal 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
|
31
src/fenrir/commands/onInput/15000-enable_temp_speech.py
Normal file
31
src/fenrir/commands/onInput/15000-enable_temp_speech.py
Normal 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
|
@ -11,6 +11,7 @@ import time
|
||||
# used as shared memory between commands
|
||||
# use this in your own commands
|
||||
commandBuffer = {
|
||||
'enableSpeechOnKeypress': False,
|
||||
'genericList':[],
|
||||
'genericListSource':'',
|
||||
'genericListSelection': 0,
|
||||
|
Loading…
Reference in New Issue
Block a user