initial char delete echo

This commit is contained in:
chrys 2016-08-06 15:33:17 +02:00
parent 30155b6d83
commit a277c10dcd
5 changed files with 33 additions and 0 deletions

View File

@ -23,6 +23,7 @@ driver=linux
[keyboard]
keyboardLayout=desktop
charEcho=False
charDeleteEcho=True
wordEcho=True
interruptOnKeyPress=False

View File

@ -0,0 +1,31 @@
#!/bin/python
class command():
def __init__(self):
pass
def run(self, environment):
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'charDeleteEcho'):
return environment
# detect typing
if environment['screenData']['newCursor']['x'] > environment['screenData']['oldCursor']['x']:
return environment
# TTY change
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
return environment
# More than just a deletion happend
if environment['screenData']['newDelta'] != environment['screenData']['oldDelta']:
return environment
# No deletion
if environment['screenData']['newNegativeDelta'] == environment['screenData']['oldNegativeDelta']:
return environment
if environment['screenData']['newNegativeDelta'] == '':
return environment
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newNegativeDelta'], interrupt=True)
return environment
def setCallback(self, callback):
pass
def shutdown(self):
pass

View File

@ -33,6 +33,7 @@ settings = {
'keyboard':{
'keyboardLayout': "desktop",
'charEcho':False,
'charDeleteEcho':True,
'wordEcho':True,
'interruptOnKeyPress': True,
}