fenrir/src/fenrirscreenreader/commands/vmenu-profiles/template.py

30 lines
1.1 KiB
Python
Raw Normal View History

2019-01-28 18:33:50 -05:00
#!/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):
2019-02-04 16:00:48 -05:00
pass
2019-01-28 18:33:50 -05:00
def initialize(self, environment):
self.env = environment
2019-02-04 16:00:48 -05:00
# examples:
# self.keyMakro = [[1,'KEY_LEFTCTRL'],[1,'KEY_O'],[0.05,'SLEEP'],[0,'KEY_O'],[0,'KEY_LEFTCTRL']]
# self.keyMakro = [[1,'KEY_LEFTSHIFT'],[1,'KEY_LEFTCTRL'],[1,'KEY_N'],[0.05,'SLEEP'],[0,'KEY_N'],[0,'KEY_LEFTCTRL'],[0,'KEY_LEFTSHIFT']]
self.keyMakro = []
self.byteMakro = []
2019-01-28 18:33:50 -05:00
def shutdown(self):
pass
def getDescription(self):
2019-02-04 16:00:48 -05:00
return 'No description found'
2019-01-28 18:33:50 -05:00
def run(self):
if self.env['runtime']['inputManager'].getShortcutType() in ['KEY']:
self.env['runtime']['inputManager'].sendKeys(self.keyMakro)
2019-02-04 16:00:48 -05:00
elif self.env['runtime']['inputManager'].getShortcutType() in ['BYTE']:
2019-01-28 18:33:50 -05:00
self.env['runtime']['byteManager'].sendBytes(self.byteMakro)
def setCallback(self, callback):
pass