From c52de66bb6e16bfee180ea02dfe98ef23a959d03 Mon Sep 17 00:00:00 2001 From: chrys Date: Tue, 29 Jan 2019 00:33:50 +0100 Subject: [PATCH] add template command --- .../curr_vmenu_entry.py | 0 .../dec_level_vmenu.py | 0 .../exec_vmenu_entry.py | 0 .../inc_level_vmenu.py | 0 .../next_vmenu_entry.py | 0 .../prev_vmenu_entry.py | 0 .../toggle_vmenu_mode.py | 0 .../KEY/mc/file/menu-entry.py | 0 .../KEY/mc/file/open.py | 0 .../KEY/mc/file/save.py | 0 .../KEY/mc/search/menu-entry.py | 0 .../KEY/mc/search/replace.py | 0 .../KEY/mc/search/search.py | 0 .../KEY/mc/search/test.py | 0 .../KEY/mutt/file/menu-entry.py | 0 .../KEY/mutt/file/open.py | 0 .../KEY/mutt/file/save.py | 0 .../KEY/mutt/search/menu-entry.py | 0 .../KEY/mutt/search/replace.py | 0 .../KEY/mutt/search/search.py | 0 .../KEY/mutt/search/test.py | 0 .../KEY/nano/file/menu-entry.py | 0 .../KEY/nano/file/open.py | 0 .../KEY/nano/file/save.py | 0 .../KEY/nano/search/menu-entry.py | 0 .../KEY/nano/search/replace.py | 0 .../KEY/nano/search/search.py | 0 .../KEY/nano/search/test.py | 0 .../KEY/vim/file/menu-entry.py | 0 .../KEY/vim/file/open.py | 0 .../KEY/vim/file/save.py | 0 .../KEY/vim/search/menu-entry.py | 0 .../KEY/vim/search/replace.py | 0 .../KEY/vim/search/search.py | 0 .../KEY/vim/search/test.py | 0 .../commands/vmenu-profiles/template.py | 25 +++++++++++++++++++ src/fenrirscreenreader/core/byteManager.py | 2 ++ src/fenrirscreenreader/core/inputManager.py | 2 ++ 38 files changed, 29 insertions(+) rename src/fenrirscreenreader/commands/{vmenu/navigation => vmenu-navigation}/curr_vmenu_entry.py (100%) rename src/fenrirscreenreader/commands/{vmenu/navigation => vmenu-navigation}/dec_level_vmenu.py (100%) rename src/fenrirscreenreader/commands/{vmenu/navigation => vmenu-navigation}/exec_vmenu_entry.py (100%) rename src/fenrirscreenreader/commands/{vmenu/navigation => vmenu-navigation}/inc_level_vmenu.py (100%) rename src/fenrirscreenreader/commands/{vmenu/navigation => vmenu-navigation}/next_vmenu_entry.py (100%) rename src/fenrirscreenreader/commands/{vmenu/navigation => vmenu-navigation}/prev_vmenu_entry.py (100%) rename src/fenrirscreenreader/commands/{vmenu/navigation => vmenu-navigation}/toggle_vmenu_mode.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/mc/file/menu-entry.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/mc/file/open.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/mc/file/save.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/mc/search/menu-entry.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/mc/search/replace.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/mc/search/search.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/mc/search/test.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/mutt/file/menu-entry.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/mutt/file/open.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/mutt/file/save.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/mutt/search/menu-entry.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/mutt/search/replace.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/mutt/search/search.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/mutt/search/test.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/nano/file/menu-entry.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/nano/file/open.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/nano/file/save.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/nano/search/menu-entry.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/nano/search/replace.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/nano/search/search.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/nano/search/test.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/vim/file/menu-entry.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/vim/file/open.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/vim/file/save.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/vim/search/menu-entry.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/vim/search/replace.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/vim/search/search.py (100%) rename src/fenrirscreenreader/commands/{vmenu => vmenu-profiles}/KEY/vim/search/test.py (100%) create mode 100644 src/fenrirscreenreader/commands/vmenu-profiles/template.py diff --git a/src/fenrirscreenreader/commands/vmenu/navigation/curr_vmenu_entry.py b/src/fenrirscreenreader/commands/vmenu-navigation/curr_vmenu_entry.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/navigation/curr_vmenu_entry.py rename to src/fenrirscreenreader/commands/vmenu-navigation/curr_vmenu_entry.py diff --git a/src/fenrirscreenreader/commands/vmenu/navigation/dec_level_vmenu.py b/src/fenrirscreenreader/commands/vmenu-navigation/dec_level_vmenu.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/navigation/dec_level_vmenu.py rename to src/fenrirscreenreader/commands/vmenu-navigation/dec_level_vmenu.py diff --git a/src/fenrirscreenreader/commands/vmenu/navigation/exec_vmenu_entry.py b/src/fenrirscreenreader/commands/vmenu-navigation/exec_vmenu_entry.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/navigation/exec_vmenu_entry.py rename to src/fenrirscreenreader/commands/vmenu-navigation/exec_vmenu_entry.py diff --git a/src/fenrirscreenreader/commands/vmenu/navigation/inc_level_vmenu.py b/src/fenrirscreenreader/commands/vmenu-navigation/inc_level_vmenu.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/navigation/inc_level_vmenu.py rename to src/fenrirscreenreader/commands/vmenu-navigation/inc_level_vmenu.py diff --git a/src/fenrirscreenreader/commands/vmenu/navigation/next_vmenu_entry.py b/src/fenrirscreenreader/commands/vmenu-navigation/next_vmenu_entry.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/navigation/next_vmenu_entry.py rename to src/fenrirscreenreader/commands/vmenu-navigation/next_vmenu_entry.py diff --git a/src/fenrirscreenreader/commands/vmenu/navigation/prev_vmenu_entry.py b/src/fenrirscreenreader/commands/vmenu-navigation/prev_vmenu_entry.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/navigation/prev_vmenu_entry.py rename to src/fenrirscreenreader/commands/vmenu-navigation/prev_vmenu_entry.py diff --git a/src/fenrirscreenreader/commands/vmenu/navigation/toggle_vmenu_mode.py b/src/fenrirscreenreader/commands/vmenu-navigation/toggle_vmenu_mode.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/navigation/toggle_vmenu_mode.py rename to src/fenrirscreenreader/commands/vmenu-navigation/toggle_vmenu_mode.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/mc/file/menu-entry.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/mc/file/menu-entry.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/mc/file/menu-entry.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/mc/file/menu-entry.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/mc/file/open.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/mc/file/open.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/mc/file/open.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/mc/file/open.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/mc/file/save.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/mc/file/save.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/mc/file/save.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/mc/file/save.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/mc/search/menu-entry.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/mc/search/menu-entry.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/mc/search/menu-entry.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/mc/search/menu-entry.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/mc/search/replace.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/mc/search/replace.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/mc/search/replace.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/mc/search/replace.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/mc/search/search.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/mc/search/search.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/mc/search/search.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/mc/search/search.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/mc/search/test.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/mc/search/test.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/mc/search/test.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/mc/search/test.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/mutt/file/menu-entry.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/mutt/file/menu-entry.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/mutt/file/menu-entry.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/mutt/file/menu-entry.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/mutt/file/open.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/mutt/file/open.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/mutt/file/open.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/mutt/file/open.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/mutt/file/save.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/mutt/file/save.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/mutt/file/save.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/mutt/file/save.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/mutt/search/menu-entry.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/mutt/search/menu-entry.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/mutt/search/menu-entry.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/mutt/search/menu-entry.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/mutt/search/replace.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/mutt/search/replace.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/mutt/search/replace.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/mutt/search/replace.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/mutt/search/search.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/mutt/search/search.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/mutt/search/search.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/mutt/search/search.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/mutt/search/test.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/mutt/search/test.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/mutt/search/test.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/mutt/search/test.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/nano/file/menu-entry.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/nano/file/menu-entry.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/nano/file/menu-entry.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/nano/file/menu-entry.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/nano/file/open.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/nano/file/open.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/nano/file/open.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/nano/file/open.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/nano/file/save.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/nano/file/save.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/nano/file/save.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/nano/file/save.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/nano/search/menu-entry.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/nano/search/menu-entry.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/nano/search/menu-entry.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/nano/search/menu-entry.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/nano/search/replace.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/nano/search/replace.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/nano/search/replace.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/nano/search/replace.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/nano/search/search.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/nano/search/search.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/nano/search/search.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/nano/search/search.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/nano/search/test.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/nano/search/test.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/nano/search/test.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/nano/search/test.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/vim/file/menu-entry.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/vim/file/menu-entry.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/vim/file/menu-entry.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/vim/file/menu-entry.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/vim/file/open.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/vim/file/open.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/vim/file/open.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/vim/file/open.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/vim/file/save.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/vim/file/save.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/vim/file/save.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/vim/file/save.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/vim/search/menu-entry.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/vim/search/menu-entry.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/vim/search/menu-entry.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/vim/search/menu-entry.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/vim/search/replace.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/vim/search/replace.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/vim/search/replace.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/vim/search/replace.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/vim/search/search.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/vim/search/search.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/vim/search/search.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/vim/search/search.py diff --git a/src/fenrirscreenreader/commands/vmenu/KEY/vim/search/test.py b/src/fenrirscreenreader/commands/vmenu-profiles/KEY/vim/search/test.py similarity index 100% rename from src/fenrirscreenreader/commands/vmenu/KEY/vim/search/test.py rename to src/fenrirscreenreader/commands/vmenu-profiles/KEY/vim/search/test.py diff --git a/src/fenrirscreenreader/commands/vmenu-profiles/template.py b/src/fenrirscreenreader/commands/vmenu-profiles/template.py new file mode 100644 index 00000000..4608e3b0 --- /dev/null +++ b/src/fenrirscreenreader/commands/vmenu-profiles/template.py @@ -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 diff --git a/src/fenrirscreenreader/core/byteManager.py b/src/fenrirscreenreader/core/byteManager.py index ebf57fcb..acac6e02 100644 --- a/src/fenrirscreenreader/core/byteManager.py +++ b/src/fenrirscreenreader/core/byteManager.py @@ -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) diff --git a/src/fenrirscreenreader/core/inputManager.py b/src/fenrirscreenreader/core/inputManager.py index e451d911..e3a13bcd 100644 --- a/src/fenrirscreenreader/core/inputManager.py +++ b/src/fenrirscreenreader/core/inputManager.py @@ -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: