keyboard stuff

This commit is contained in:
chrys 2016-07-10 19:11:38 +02:00
parent 4f5ced7ed2
commit 79f8a3bf1e
2 changed files with 0 additions and 12 deletions

View File

@ -22,7 +22,6 @@ class inputManager():
del(currShortcut[str(event.code)]) del(currShortcut[str(event.code)])
environment['input']['currShortcut'] = currShortcut environment['input']['currShortcut'] = currShortcut
environment['input']['currShortcutString'] = self.getShortcutString(environment) environment['input']['currShortcutString'] = self.getShortcutString(environment)
print(environment['input']['currShortcutString'])
return environment return environment
def getShortcutString(self, environment): def getShortcutString(self, environment):
@ -72,18 +71,14 @@ class inputManager():
break break
else: else:
currShortcut.append(key[0] + '-' + str(keyInt)) currShortcut.append(key[0] + '-' + str(keyInt))
print(currShortcut)
if validKeyString: if validKeyString:
keyString = '' keyString = ''
for k in sorted(currShortcut): for k in sorted(currShortcut):
if keyString != '': if keyString != '':
keyString += ',' keyString += ','
keyString += k keyString += k
print(keyString)
print(commandString)
environment['bindings'][keyString] = commandString environment['bindings'][keyString] = commandString
kbConfig.close() kbConfig.close()
print(environment['bindings'])
return environment return environment
def getCodeForKeyID(self, keyID): def getCodeForKeyID(self, keyID):

View File

@ -46,18 +46,11 @@ class screenManager():
environment['screenData']['oldCursor']['x'] = 0 environment['screenData']['oldCursor']['x'] = 0
environment['screenData']['oldCursor']['y'] = 0 environment['screenData']['oldCursor']['y'] = 0
environment['runtime']['speechDriver'].cancel() environment['runtime']['speechDriver'].cancel()
print('runs')
# changes on the screen # changes on the screen
if (environment['screenData']['oldContentText'] != environment['screenData']['newContentText']) and \ if (environment['screenData']['oldContentText'] != environment['screenData']['newContentText']) and \
(len(environment['screenData']['newContentText']) > 0): (len(environment['screenData']['newContentText']) > 0):
print('runs1')
diff = difflib.ndiff(environment['screenData']['oldContentText'], environment['screenData']['newContentText']) diff = difflib.ndiff(environment['screenData']['oldContentText'], environment['screenData']['newContentText'])
print('runs2')
print(environment['screenData']['oldContentText'])
print(environment['screenData']['newContentText'])
environment['screenData']['delta'] = ''.join(x[2:] for x in diff if x.startswith('+ ')) environment['screenData']['delta'] = ''.join(x[2:] for x in diff if x.startswith('+ '))
print(environment['screenData']['delta'])
print('______________________________________')
if ((len(environment['screenData']['delta']) < 3)): if ((len(environment['screenData']['delta']) < 3)):
environment['runtime']['speechDriver'].cancel() environment['runtime']['speechDriver'].cancel()
environment['runtime']['speechDriver'].speak(environment['screenData']['delta']) environment['runtime']['speechDriver'].speak(environment['screenData']['delta'])