toggle for tutorial mode
This commit is contained in:
parent
d883f7e213
commit
4da2d7020c
@ -1,3 +1,4 @@
|
||||
#=toggle_tutorial_mode
|
||||
KEY_CTRL=shut_up
|
||||
KEY_FENRIR,KEY_KP9=review_bottom
|
||||
KEY_FENRIR,KEY_KP7=review_top
|
||||
|
@ -1,3 +1,4 @@
|
||||
#=toggle_tutorial_mode
|
||||
KEY_CTRL=shut_up
|
||||
KEY_FENRIR,KEY_SHIFT,KEY_O=review_bottom
|
||||
KEY_FENRIR,KEY_SHIFT,KEY_U=review_top
|
||||
|
@ -1,3 +1,4 @@
|
||||
#=toggle_tutorial_mode
|
||||
1-KEY_LEFTCTRL=shut_up
|
||||
1-FENRIR,1-KEY_RIGHTCTRL=shut_up
|
||||
1-FENRIR,1-KEY_KPENTER=review_bottom
|
||||
|
20
src/fenrir-package/commands/commands/toggle_tutorial_mode.py
Normal file
20
src/fenrir-package/commands/commands/toggle_tutorial_mode.py
Normal 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
|
26
src/fenrir-package/commands/onInput/10000-shut_up.py
Normal file
26
src/fenrir-package/commands/onInput/10000-shut_up.py
Normal 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
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user