filter out invalid shortcuts

This commit is contained in:
chrys 2016-10-18 15:23:51 +02:00
parent b3a62dff4e
commit bd4cbce395

View File

@ -55,6 +55,9 @@ class settingsManager():
shortcutKeys.append(key.upper()) shortcutKeys.append(key.upper())
shortcut.append(shortcutRepeat) shortcut.append(shortcutRepeat)
shortcut.append(sorted(shortcutKeys)) shortcut.append(sorted(shortcutKeys))
if len(shortcutKeys) != 1 and not 'KEY_FENRIR' in shortcutKeys:
self.env['runtime']['debug'].writeDebugOut("invalid shortcut (missing KEY_FENRIR): "+ str(shortcut) + ' command:' +commandName ,debug.debugLevel.ERROR, onAnyLevel=True)
continue
self.env['runtime']['debug'].writeDebugOut("Shortcut: "+ str(shortcut) + ' command:' +commandName ,debug.debugLevel.INFO, onAnyLevel=True) self.env['runtime']['debug'].writeDebugOut("Shortcut: "+ str(shortcut) + ' command:' +commandName ,debug.debugLevel.INFO, onAnyLevel=True)
self.env['bindings'][str(shortcut)] = commandName self.env['bindings'][str(shortcut)] = commandName
kbConfig.close() kbConfig.close()