add inByteInput trigger
This commit is contained in:
parent
65055acb66
commit
0e26ac8cc0
33
src/fenrirscreenreader/commands/onByteInput/10000-shut_up.py
Normal file
33
src/fenrirscreenreader/commands/onByteInput/10000-shut_up.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#!/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']['screenManager'].isScreenChange():
|
||||||
|
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
|
@ -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 _('disables speech until next keypress')
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
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
|
@ -83,14 +83,14 @@ class fenrirManager():
|
|||||||
self.singleKeyCommand = False
|
self.singleKeyCommand = False
|
||||||
if self.environment['input']['keyForeward'] > 0:
|
if self.environment['input']['keyForeward'] > 0:
|
||||||
self.environment['input']['keyForeward'] -=1
|
self.environment['input']['keyForeward'] -=1
|
||||||
self.environment['runtime']['commandManager'].executeDefaultTrigger('onInput')
|
self.environment['runtime']['commandManager'].executeDefaultTrigger('onKeyInput')
|
||||||
#print('handleInput:',time.time() - startTime)
|
#print('handleInput:',time.time() - startTime)
|
||||||
def handleByteInput(self, event):
|
def handleByteInput(self, event):
|
||||||
if not event['Data']:
|
if not event['Data']:
|
||||||
return
|
return
|
||||||
if event['Data'] == b'':
|
if event['Data'] == b'':
|
||||||
return
|
return
|
||||||
|
self.environment['runtime']['commandManager'].executeDefaultTrigger('onByteInput')
|
||||||
isCommand = False
|
isCommand = False
|
||||||
if self.controlMode and not self.switchCtrlModeOnce == 1 or\
|
if self.controlMode and not self.switchCtrlModeOnce == 1 or\
|
||||||
not self.controlMode and self.switchCtrlModeOnce == 1:
|
not self.controlMode and self.switchCtrlModeOnce == 1:
|
||||||
|
@ -13,6 +13,6 @@ generalData = {
|
|||||||
'prevUser':'',
|
'prevUser':'',
|
||||||
'managerList':['processManager', 'punctuationManager', 'byteManager', 'cursorManager', 'applicationManager', 'commandManager'
|
'managerList':['processManager', 'punctuationManager', 'byteManager', 'cursorManager', 'applicationManager', 'commandManager'
|
||||||
, 'screenManager', 'inputManager','outputManager', 'helpManager', 'memoryManager', 'eventManager', 'debug'],
|
, 'screenManager', 'inputManager','outputManager', 'helpManager', 'memoryManager', 'eventManager', 'debug'],
|
||||||
'commandFolderList':['commands','onInput', 'onCursorChange', 'onScreenUpdate','onScreenChanged','onHeartBeat', 'onPlugInputDevice'
|
'commandFolderList':['commands','onKeyInput', 'onByteInput', 'onCursorChange', 'onScreenUpdate','onScreenChanged','onHeartBeat', 'onPlugInputDevice'
|
||||||
,'onApplicationChange','onSwitchApplicationProfile','help',],
|
,'onApplicationChange','onSwitchApplicationProfile','help',],
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user