add inByteInput trigger

This commit is contained in:
chrys
2018-03-26 20:09:51 +02:00
parent 65055acb66
commit 0e26ac8cc0
11 changed files with 63 additions and 3 deletions

View File

@ -0,0 +1,37 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return ''
def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'interruptOnKeyPress'):
return
if self.env['runtime']['inputManager'].noKeyPressed():
return
if self.env['runtime']['screenManager'].isScreenChange():
return
if len(self.env['input']['currInput']) <= len(self.env['input']['prevInput']):
return
# if the filter is set
if self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').strip() != '':
filterList = self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').split(',')
for currInput in self.env['input']['currInput']:
if not currInput in filterList:
return
self.env['runtime']['outputManager'].interruptOutput()
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 fenrirscreenreader.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

@ -0,0 +1,27 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return 'No description found'
def run(self):
if self.env['input']['oldCapsLock'] == self.env['input']['newCapsLock']:
return
if self.env['input']['newCapsLock']:
self.env['runtime']['outputManager'].presentText(_("Capslock on"), interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_("Capslock off"), interrupt=True)
def setCallback(self, callback):
pass

View File

@ -0,0 +1,27 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return 'No description found'
def run(self):
if self.env['input']['oldScrollLock'] == self.env['input']['newScrollLock']:
return
if self.env['input']['newScrollLock']:
self.env['runtime']['outputManager'].presentText(_("Scrolllock on"), interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_("Scrolllock off"), interrupt=True)
def setCallback(self, callback):
pass

View File

@ -0,0 +1,27 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return 'No description found'
def run(self):
if self.env['input']['oldNumLock'] == self.env['input']['newNumLock']:
return
if self.env['input']['newNumLock']:
self.env['runtime']['outputManager'].presentText(_("Numlock on"), interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_("Numlock off"), interrupt=True)
def setCallback(self, callback):
pass