add template command
This commit is contained in:
parent
5a13b87b7c
commit
c52de66bb6
25
src/fenrirscreenreader/commands/vmenu-profiles/template.py
Normal file
25
src/fenrirscreenreader/commands/vmenu-profiles/template.py
Normal 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
|
@ -82,6 +82,8 @@ class byteManager():
|
|||||||
self.env['runtime']['outputManager'].presentText(_('bypass'), soundIcon='PTYBypass', interrupt=True, flush=True)
|
self.env['runtime']['outputManager'].presentText(_('bypass'), soundIcon='PTYBypass', interrupt=True, flush=True)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
def sendBytes(self, byteMacro):
|
||||||
|
pass
|
||||||
def detectByteCommand(self, escapeSequence):
|
def detectByteCommand(self, escapeSequence):
|
||||||
convertedEscapeSequence = self.unifyEscapeSeq(escapeSequence)
|
convertedEscapeSequence = self.unifyEscapeSeq(escapeSequence)
|
||||||
command = self.env['runtime']['inputManager'].getCommandForShortcut(convertedEscapeSequence)
|
command = self.env['runtime']['inputManager'].getCommandForShortcut(convertedEscapeSequence)
|
||||||
|
@ -61,6 +61,8 @@ class inputManager():
|
|||||||
else:
|
else:
|
||||||
self.grabAllDevices()
|
self.grabAllDevices()
|
||||||
self.executeDeviceGrab = False
|
self.executeDeviceGrab = False
|
||||||
|
def sendKeys(self, keyMacro):
|
||||||
|
pass
|
||||||
def handleInputEvent(self, eventData):
|
def handleInputEvent(self, eventData):
|
||||||
#print(eventData)
|
#print(eventData)
|
||||||
if not eventData:
|
if not eventData:
|
||||||
|
Loading…
Reference in New Issue
Block a user