respect multible keys for interrupt

This commit is contained in:
chrys 2016-12-22 21:58:04 +01:00
parent 4262f70bd5
commit 62c07748f9

View File

@ -18,19 +18,19 @@ class command():
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'interruptOnKeyPress'): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'interruptOnKeyPress'):
return
if self.env['runtime']['inputManager'].noKeyPressed():
return
if len(self.env['input']['prevDeepestInput']) > len(self.env['input']['currInput']):
return return
if len(self.env['input']['currInput']) != 1: if self.env['runtime']['inputManager'].noKeyPressed():
return
if self.env['runtime']['screenManager'].isScreenChange():
return
if len(self.env['input']['prevDeepestInput']) > len(self.env['input']['currInput']):
return return
# if the filter is set # if the filter is set
if self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').strip() != '': if self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').strip() != '':
if not self.env['input']['currInput'][0] in self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').split(','): filterList = self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').split(',')
return for currInput in self.env['input']['currInput']:
if self.env['runtime']['screenManager'].isScreenChange(): if not currInput in filterList:
return return
self.env['runtime']['outputManager'].interruptOutput() self.env['runtime']['outputManager'].interruptOutput()
def setCallback(self, callback): def setCallback(self, callback):