add first letter navigation to vmenu

This commit is contained in:
chrys 2019-02-12 22:33:16 +01:00
parent 58208beb3a
commit 7ce471cd08
28 changed files with 729 additions and 27 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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('a')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('b')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('c')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('d')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('e')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('f')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('g')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('h')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('i')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('j')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('k')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('l')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('m')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('n')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('o')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('p')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('q')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('r')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('s')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('t')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('u')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('v')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('a')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('x')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('y')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

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):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('search for an menu entry')
def run(self):
text = self.env['runtime']['vmenuManager'].searchEntry('z')
if text != '':
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
def setCallback(self, callback):
pass

View File

@ -10,7 +10,8 @@ from fenrirscreenreader.core import debug
class helpManager(): class helpManager():
def __init__(self): def __init__(self):
self.helpDict = {} self.helpDict = {}
self.tutorialListIndex = None self.tutorialListIndex = None
self.bindingsBackup = None
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
@ -18,21 +19,26 @@ class helpManager():
def toggleTutorialMode(self): def toggleTutorialMode(self):
self.setTutorialMode(not self.env['general']['tutorialMode']) self.setTutorialMode(not self.env['general']['tutorialMode'])
def setTutorialMode(self, newTutorialMode): def setTutorialMode(self, newTutorialMode):
self.env['general']['tutorialMode'] = newTutorialMode if self.environment['runtime']['vmenuManager'].getActive():
return
self.env['general']['tutorialMode'] = newTutorialMode
if newTutorialMode: if newTutorialMode:
self.createHelpDict() self.bindingsBackup = self.env['bindings'].copy()
self.createHelpDict()
self.env['bindings'][str([1, ['KEY_ESC']])] = 'TOGGLE_TUTORIAL_MODE' self.env['bindings'][str([1, ['KEY_ESC']])] = 'TOGGLE_TUTORIAL_MODE'
self.env['bindings'][str([1, ['KEY_UP']])] = 'PREV_HELP' self.env['bindings'][str([1, ['KEY_UP']])] = 'PREV_HELP'
self.env['bindings'][str([1, ['KEY_DOWN']])] = 'NEXT_HELP' self.env['bindings'][str([1, ['KEY_DOWN']])] = 'NEXT_HELP'
self.env['bindings'][str([1, ['KEY_SPACE']])] = 'CURR_HELP' self.env['bindings'][str([1, ['KEY_SPACE']])] = 'CURR_HELP'
else: else:
try: try:
del(self.env['bindings'][str([1, ['KEY_ESC']])]) self.env['bindings'] = self.bindingsBackup.copy()
del(self.env['bindings'][str([1, ['KEY_UP']])]) self.bindingsBackup = None
del(self.env['bindings'][str([1, ['KEY_DOWN']])]) #del(self.env['bindings'][str([1, ['KEY_ESC']])])
del(self.env['bindings'][str([1, ['KEY_SPACE']])]) #del(self.env['bindings'][str([1, ['KEY_UP']])])
#del(self.env['bindings'][str([1, ['KEY_DOWN']])])
#del(self.env['bindings'][str([1, ['KEY_SPACE']])])
except: except:
pass pass
def isTutorialMode(self): def isTutorialMode(self):
return self.env['general']['tutorialMode'] return self.env['general']['tutorialMode']
def getCommandHelpText(self, command, section = 'commands'): def getCommandHelpText(self, command, section = 'commands'):

View File

@ -17,8 +17,11 @@ class vmenuManager():
self.currIndex = None self.currIndex = None
self.currMenu = '' self.currMenu = ''
self.active = False self.active = False
self.reset = True
self.useTimeout = True
self.searchText = '' self.searchText = ''
self.lastSearchTime = time.time() self.lastSearchTime = time.time()
self.bindingsBackup = None
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
# use default path # use default path
@ -34,22 +37,29 @@ class vmenuManager():
self.closeAfterAction = False self.closeAfterAction = False
def shutdown(self): def shutdown(self):
pass pass
def searchEntry(self, value): def clearSearchText(self):
self.searchText = ''
def searchEntry(self, value, forceReset = False):
if self.currIndex == None: if self.currIndex == None:
return False return ''
if time.time() - self.lastSearchTime > 1: if self.reset or forceReset:
self.searchText = '' self.clearSearchText()
else:
if self.useTimeout:
if time.time() - self.lastSearchTime > 1:
self.clearSearchText()
self.searchText += value self.searchText += value
self.lastSearchTime = time.time() self.lastSearchTime = time.time()
startIndex = 0 startIndex = self.getCurrIndex()
while True: while True:
if not self.nextIndex():
return ''
entry = self.getCurrentEntry() entry = self.getCurrentEntry()
if entry.startswith(self.searchText): if entry.startswith(self.searchText):
return True return entry
if not self.nextIndex(): if startIndex == self.getCurrIndex():
return False return ''
if True:
return False
def setCurrMenu(self, currMenu = ''): def setCurrMenu(self, currMenu = ''):
self.currIndex = None self.currIndex = None
self.currMenu = '' self.currMenu = ''
@ -76,6 +86,8 @@ class vmenuManager():
def togglelVMenuMode(self, closeAfterAction = True): def togglelVMenuMode(self, closeAfterAction = True):
self.setActive(not self.getActive(), closeAfterAction) self.setActive(not self.getActive(), closeAfterAction)
def setActive(self, active, closeAfterAction = True): def setActive(self, active, closeAfterAction = True):
if self.env['runtime']['helpManager'].isTutorialMode():
return
self.active = active self.active = active
if self.active: if self.active:
self.closeAfterAction = closeAfterAction self.closeAfterAction = closeAfterAction
@ -92,6 +104,8 @@ class vmenuManager():
except Exception as e: except Exception as e:
print(e) print(e)
try: try:
self.bindingsBackup = self.env['bindings'].copy()
# navigation
self.env['bindings'][str([1, ['KEY_ESC']])] = 'TOGGLE_VMENU_MODE' self.env['bindings'][str([1, ['KEY_ESC']])] = 'TOGGLE_VMENU_MODE'
self.env['bindings'][str([1, ['KEY_UP']])] = 'PREV_VMENU_ENTRY' self.env['bindings'][str([1, ['KEY_UP']])] = 'PREV_VMENU_ENTRY'
self.env['bindings'][str([1, ['KEY_DOWN']])] = 'NEXT_VMENU_ENTRY' self.env['bindings'][str([1, ['KEY_DOWN']])] = 'NEXT_VMENU_ENTRY'
@ -99,18 +113,47 @@ class vmenuManager():
self.env['bindings'][str([1, ['KEY_LEFT']])] = 'DEC_LEVEL_VMENU' self.env['bindings'][str([1, ['KEY_LEFT']])] = 'DEC_LEVEL_VMENU'
self.env['bindings'][str([1, ['KEY_RIGHT']])] = 'INC_LEVEL_VMENU' self.env['bindings'][str([1, ['KEY_RIGHT']])] = 'INC_LEVEL_VMENU'
self.env['bindings'][str([1, ['KEY_ENTER']])] = 'EXEC_VMENU_ENTRY' self.env['bindings'][str([1, ['KEY_ENTER']])] = 'EXEC_VMENU_ENTRY'
# search
self.env['bindings'][str([1, ['KEY_A']])] = 'SEARCH_A'
self.env['bindings'][str([1, ['KEY_B']])] = 'SEARCH_B'
self.env['bindings'][str([1, ['KEY_C']])] = 'SEARCH_C'
self.env['bindings'][str([1, ['KEY_D']])] = 'SEARCH_D'
self.env['bindings'][str([1, ['KEY_E']])] = 'SEARCH_E'
self.env['bindings'][str([1, ['KEY_F']])] = 'SEARCH_F'
self.env['bindings'][str([1, ['KEY_G']])] = 'SEARCH_G'
self.env['bindings'][str([1, ['KEY_H']])] = 'SEARCH_H'
self.env['bindings'][str([1, ['KEY_I']])] = 'SEARCH_I'
self.env['bindings'][str([1, ['KEY_J']])] = 'SEARCH_J'
self.env['bindings'][str([1, ['KEY_K']])] = 'SEARCH_K'
self.env['bindings'][str([1, ['KEY_L']])] = 'SEARCH_L'
self.env['bindings'][str([1, ['KEY_M']])] = 'SEARCH_M'
self.env['bindings'][str([1, ['KEY_N']])] = 'SEARCH_N'
self.env['bindings'][str([1, ['KEY_O']])] = 'SEARCH_O'
self.env['bindings'][str([1, ['KEY_P']])] = 'SEARCH_P'
self.env['bindings'][str([1, ['KEY_Q']])] = 'SEARCH_Q'
self.env['bindings'][str([1, ['KEY_R']])] = 'SEARCH_R'
self.env['bindings'][str([1, ['KEY_S']])] = 'SEARCH_S'
self.env['bindings'][str([1, ['KEY_T']])] = 'SEARCH_T'
self.env['bindings'][str([1, ['KEY_U']])] = 'SEARCH_U'
self.env['bindings'][str([1, ['KEY_V']])] = 'SEARCH_V'
self.env['bindings'][str([1, ['KEY_W']])] = 'SEARCH_W'
self.env['bindings'][str([1, ['KEY_X']])] = 'SEARCH_X'
self.env['bindings'][str([1, ['KEY_Y']])] = 'SEARCH_Y'
self.env['bindings'][str([1, ['KEY_Z']])] = 'SEARCH_Z'
except Exception as e: except Exception as e:
print(e) print(e)
else: else:
try: try:
self.currIndex = None self.currIndex = None
del(self.env['bindings'][str([1, ['KEY_ESC']])]) self.env['bindings'] = self.bindingsBackup.copy()
del(self.env['bindings'][str([1, ['KEY_UP']])]) self.bindingsBackup = None
del(self.env['bindings'][str([1, ['KEY_DOWN']])]) #del(self.env['bindings'][str([1, ['KEY_ESC']])])
del(self.env['bindings'][str([1, ['KEY_SPACE']])]) #del(self.env['bindings'][str([1, ['KEY_UP']])])
del(self.env['bindings'][str([1, ['KEY_LEFT']])]) #del(self.env['bindings'][str([1, ['KEY_DOWN']])])
del(self.env['bindings'][str([1, ['KEY_RIGHT']])]) #del(self.env['bindings'][str([1, ['KEY_SPACE']])])
del(self.env['bindings'][str([1, ['KEY_ENTER']])]) #del(self.env['bindings'][str([1, ['KEY_LEFT']])])
#del(self.env['bindings'][str([1, ['KEY_RIGHT']])])
#del(self.env['bindings'][str([1, ['KEY_ENTER']])])
except: except:
pass pass
def createMenuTree(self): def createMenuTree(self):
@ -164,7 +207,10 @@ class vmenuManager():
else: else:
self.currIndex[len(self.currIndex) - 1] += 1 self.currIndex[len(self.currIndex) - 1] += 1
return True return True
def getCurrIndex(self):
if self.currIndex == None:
return 0
return self.currIndex[len(self.currIndex) - 1]
def prevIndex(self): def prevIndex(self):
if self.currIndex == None: if self.currIndex == None:
return False return False