add initial script support

This commit is contained in:
chrys 2016-10-18 20:25:27 +02:00
parent c99c45436e
commit ce93c54812
4 changed files with 7 additions and 6 deletions

View File

@ -85,7 +85,6 @@ class commandManager():
keys = commSettings[1]
elif len(commSettings) > 2:
continue
keys = keys.split('__+__')
shortcutKeys = []
shortcut = []
@ -95,7 +94,6 @@ class commandManager():
shortcutKeys.append('KEY_SCRIPT')
shortcut.append(1)
shortcut.append(sorted(shortcutKeys))
print(shortcut,command)
self.env['bindings'][str(shortcut)] = fileName.upper()
except Exception as e:
print(e)

View File

@ -47,8 +47,8 @@ settings = {
'newLinePause':True,
'numberOfClipboards': 10,
'emoticons': True,
'fenrirKeys': ['KEY_KP0','KEY_META'],
'scriptKeys': ['KEY_COMPOSE'],
'fenrirKeys': 'KEY_KP0,KEY_META',
'scriptKeys': 'KEY_COMPOSE',
'timeFormat': '%I:%M%P',
'dateFormat': '%A, %B %d, %Y',
'autoSpellCheck': False,

View File

@ -192,6 +192,7 @@ class settingsManager():
for key in keyList:
if not key in self.env['input']['scriptKey']:
self.env['input']['scriptKey'].append(key)
def initFenrirConfig(self, environment = environment.environment, settingsRoot = '/etc/fenrir/', settingsFile='settings.conf', soundRoot = '/usr/share/sounds/fenrir'):
environment['runtime']['debug'] = debug.debug()
environment['runtime']['debug'].initialize(environment)
@ -210,8 +211,10 @@ class settingsManager():
validConfig = environment['runtime']['settingsManager'].loadSettings(settingsRoot + '/settings/' + settingsFile)
if not validConfig:
return None
self.setFenrirKeys(self.getSetting('general','fenrirKeys'))
self.setScriptKeys(self.getSetting('general','scriptKeys'))
self.setScriptKeys(self.getSetting('general','scriptKeys'))
if not os.path.exists(self.getSetting('keyboard','keyboardLayout')):
if os.path.exists(settingsRoot + 'keyboard/' + self.getSetting('keyboard','keyboardLayout')):
self.setSetting('keyboard', 'keyboardLayout', settingsRoot + 'keyboard/' + self.getSetting('keyboard','keyboardLayout'))

View File

@ -39,7 +39,7 @@ class fenrir():
eventReceived = self.environment['runtime']['inputManager'].getInputEvent()
if eventReceived:
self.prepareCommand()
if not (self.wasCommand or self.environment['runtime']['inputManager'].isFenrirKeyPressed() or self.environment['generalInformation']['tutorialMode']) or self.environment['runtime']['screenManager'].isSuspendingScreen():
if not (self.wasCommand or self.environment['runtime']['inputManager'].isFenrirKeyPressed() or self.environment['runtime']['inputManager'].isScriptKeyPressed() or self.environment['generalInformation']['tutorialMode']) or self.environment['runtime']['screenManager'].isSuspendingScreen():
self.environment['runtime']['inputManager'].writeEventBuffer()
if self.environment['runtime']['inputManager'].noKeyPressed():
if self.wasCommand: