keyboard echo

This commit is contained in:
chrys 2016-07-17 14:25:59 +02:00
parent 659e99d810
commit 0410c33a08
4 changed files with 35 additions and 7 deletions

View File

@ -21,8 +21,12 @@ layout=en
['screen]
driver=linux
[general]
[keyboard]
keyboardLayout=desktop
charEcho=False
wordEcho=True
[general]
debugLevel=0
punctuationLevel=1

View File

@ -4,6 +4,12 @@ class command():
def __init__(self):
pass
def run(self, environment):
print(environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'charEcho') )
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'charEcho') and\
len(environment['screenData']['newDelta']) <= 2 and \
environment['screenData']['newCursor'] != environment['screenData']['oldCursor']:
print('dri')
return environment
if environment['screenData']['newDelta'] == environment['screenData']['oldDelta'] and \
environment['screenData']['newTTY'] == environment['screenData']['oldTTY']:
return environment

View File

@ -29,5 +29,10 @@ settings = {
'keyboardLayout': "desktop",
'debugLevel': debug.debugLevel.DEACTIVE,
'punctuationLevel': 1
},
'keyboard':{
'keyboardLayout': "desktop",
'charEcho':False,
'wordEcho':True,
}
}

View File

@ -81,14 +81,27 @@ class settingsManager():
return value
def getSettingAsInt(self, environment, section, setting):
return int(self.getSetting( environment, section, setting))
value = ''
try:
value = environment['settings'].getint(section, setting)
except:
value = self.settings[section][setting]
return value
def getSettingAsFloat(self, environment, section, setting):
return float(self.getSetting( environment, section, setting))
value = ''
try:
value = environment['settings'].getfloat(section, setting)
except:
value = self.settings[section][setting]
return value
def getSettingAsBool(self, environment, section, setting):
return bool(self.getSetting(environment, section, setting))
value = ''
try:
value = environment['settings'].getboolean(section, setting)
except:
value = self.settings[section][setting]
return value
def loadSpeechDriver(self, environment, driverName):
if environment['runtime']['speechDriver'] != None:
environment['runtime']['speechDriver'].shutdown()