toggle for tutorial mode

This commit is contained in:
chrys
2016-09-17 02:30:34 +02:00
parent d883f7e213
commit 4da2d7020c
6 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,20 @@
#!/bin/python
class command():
def __init__(self):
pass
def initialize(self, environment):
return environment
def shutdown(self, environment):
return environment
def getDescription(self, environment):
environment['generalInformation']['tutorialMode'] = False
return 'You are leving the tutorial mode. Press that shortcut again to enter the tutorial mode again.'
def run(self, environment):
text = 'you entered the tutorial mode. In that mode the commands are not executed. but you get an description what the shortcut does. to leve the tutorial mode press that shortcut again.'
environment['runtime']['outputManager'].presentText(environment, text, interrupt=True)
environment['generalInformation']['tutorialMode'] = True
return environment
def setCallback(self, callback):
pass

View File

@ -0,0 +1,26 @@
#!/bin/python
class command():
def __init__(self):
pass
def initialize(self, environment):
return environment
def shutdown(self, environment):
return environment
def getDescription(self, environment):
return ''
def run(self, environment):
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'interruptOnKeyPress'):
return environment
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
return environment
# if environment['screenData']['newCursor'] == environment['screenData']['oldCursor'] and\
# environment['screenData']['newDelta'] == environment['screenData']['oldDelta']:
# return environment
if environment['input']['currShortcut'] != '':
return environment
environment['runtime']['outputManager'].interruptOutput(environment)
return environment
def setCallback(self, callback):
pass

View File

@ -28,7 +28,8 @@ class inputManager():
return timeout
def grabDevices(self, environment):
environment['runtime']['inputDriver'].grabDevices(environment)
if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'grabDevices'):
environment['runtime']['inputDriver'].grabDevices(environment)
def releaseDevices(self, environment):
environment['runtime']['inputDriver'].releaseDevices()