add template command

This commit is contained in:
chrys 2019-01-29 00:33:50 +01:00
parent 5a13b87b7c
commit c52de66bb6
38 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,25 @@
#!/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):
self.keyMakro = []
self.byteMakro = []
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return 'No description found'
def run(self):
if self.env['runtime']['inputManager'].getShortcutType() in ['KEY']:
self.env['runtime']['inputManager'].sendKeys(self.keyMakro)
if self.env['runtime']['inputManager'].getShortcutType() in ['BYTE']:
self.env['runtime']['byteManager'].sendBytes(self.byteMakro)
def setCallback(self, callback):
pass

View File

@ -82,6 +82,8 @@ class byteManager():
self.env['runtime']['outputManager'].presentText(_('bypass'), soundIcon='PTYBypass', interrupt=True, flush=True)
return True
return False
def sendBytes(self, byteMacro):
pass
def detectByteCommand(self, escapeSequence):
convertedEscapeSequence = self.unifyEscapeSeq(escapeSequence)
command = self.env['runtime']['inputManager'].getCommandForShortcut(convertedEscapeSequence)

View File

@ -61,6 +61,8 @@ class inputManager():
else:
self.grabAllDevices()
self.executeDeviceGrab = False
def sendKeys(self, keyMacro):
pass
def handleInputEvent(self, eventData):
#print(eventData)
if not eventData: