add initial keyforwart for new input handling

This commit is contained in:
chrys 2016-09-25 20:30:50 +02:00
parent e02b33f653
commit 6ae0cd85fa
4 changed files with 6 additions and 4 deletions

View File

@ -39,7 +39,7 @@ KEY_FENRIR,KEY_T=time
KEY_FENRIR,KEY_S=spell_check KEY_FENRIR,KEY_S=spell_check
2,KEY_FENRIR,KEY_S=add_word_to_spell_check 2,KEY_FENRIR,KEY_S=add_word_to_spell_check
KEY_FENRIR,KEY_SHIFT,KEY_S=remove_word_from_spell_check KEY_FENRIR,KEY_SHIFT,KEY_S=remove_word_from_spell_check
KEY_FENRIR,KEY_BACKSPACE=foreward_keypress KEY_FENRIR,KEY_BACKSPACE=forward_keypress
KEY_FENRIR,KEY_UP=inc_speech_volume KEY_FENRIR,KEY_UP=inc_speech_volume
KEY_FENRIR,KEY_DOWN=dec_speech_volume KEY_FENRIR,KEY_DOWN=dec_speech_volume
KEY_FENRIR,KEY_RIGHT=inc_speech_rate KEY_FENRIR,KEY_RIGHT=inc_speech_rate

View File

@ -39,7 +39,7 @@ KEY_FENRIR,KEY_T=time
KEY_FENRIR,KEY_S=spell_check KEY_FENRIR,KEY_S=spell_check
2,KEY_FENRIR,KEY_S=add_word_to_spell_check 2,KEY_FENRIR,KEY_S=add_word_to_spell_check
KEY_FENRIR,KEY_SHIFT,KEY_S=remove_word_from_spell_check KEY_FENRIR,KEY_SHIFT,KEY_S=remove_word_from_spell_check
KEY_FENRIR,KEY_BACKSPACE=foreward_keypress KEY_FENRIR,KEY_BACKSPACE=forward_keypress
KEY_FENRIR,KEY_UP=inc_speech_volume KEY_FENRIR,KEY_UP=inc_speech_volume
KEY_FENRIR,KEY_DOWN=dec_speech_volume KEY_FENRIR,KEY_DOWN=dec_speech_volume
KEY_FENRIR,KEY_RIGHT=inc_speech_rate KEY_FENRIR,KEY_RIGHT=inc_speech_rate

View File

@ -17,7 +17,7 @@ class command():
return 'sends the following keypress to the terminal' return 'sends the following keypress to the terminal'
def run(self): def run(self):
self.env['input']['keyForeward'] = 2 self.env['input']['keyForeward'] = 3
self.env['runtime']['outputManager'].presentText('Foreward next keypress', interrupt=True) self.env['runtime']['outputManager'].presentText('Foreward next keypress', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):

View File

@ -51,6 +51,8 @@ class fenrir():
self.environment['runtime']['inputManager'].clearEventBuffer() self.environment['runtime']['inputManager'].clearEventBuffer()
if self.environment['generalInformation']['tutorialMode']: if self.environment['generalInformation']['tutorialMode']:
self.environment['runtime']['inputManager'].clearEventBuffer() self.environment['runtime']['inputManager'].clearEventBuffer()
if self.environment['input']['keyForeward'] > 0:
self.environment['input']['keyForeward'] -=1
self.environment['input']['prevDeepestInput'] = [] self.environment['input']['prevDeepestInput'] = []
self.environment['runtime']['screenManager'].update() self.environment['runtime']['screenManager'].update()
@ -72,7 +74,7 @@ class fenrir():
self.handleCommands() self.handleCommands()
def prepareCommand(self): def prepareCommand(self):
if self.environment['input']['keyForeward']: if self.environment['input']['keyForeward'] > 0:
return return
shortcut = self.environment['runtime']['inputManager'].getCurrShortcut() shortcut = self.environment['runtime']['inputManager'].getCurrShortcut()
print(shortcut) print(shortcut)