Update inputManager.py
This commit is contained in:
parent
51c2db5b85
commit
8e6d09df3d
@ -15,7 +15,7 @@ class inputManager():
|
|||||||
self.env = environment
|
self.env = environment
|
||||||
self.env['runtime']['settingsManager'].loadDriver(\
|
self.env['runtime']['settingsManager'].loadDriver(\
|
||||||
self.env['runtime']['settingsManager'].getSetting('keyboard', 'driver'), 'inputDriver')
|
self.env['runtime']['settingsManager'].getSetting('keyboard', 'driver'), 'inputDriver')
|
||||||
self.env['runtime']['inputManager'].updateInputDevices()
|
self.updateInputDevices()
|
||||||
# init LEDs with current state
|
# init LEDs with current state
|
||||||
self.env['input']['newNumLock'] = self.env['runtime']['inputDriver'].getLedState()
|
self.env['input']['newNumLock'] = self.env['runtime']['inputDriver'].getLedState()
|
||||||
self.env['input']['oldNumLock'] = self.env['input']['newNumLock']
|
self.env['input']['oldNumLock'] = self.env['input']['newNumLock']
|
||||||
@ -25,7 +25,7 @@ class inputManager():
|
|||||||
self.env['input']['oldScrollLock'] = self.env['input']['newScrollLock']
|
self.env['input']['oldScrollLock'] = self.env['input']['newScrollLock']
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
self.env['runtime']['inputManager'].removeAllDevices()
|
self.removeAllDevices()
|
||||||
self.env['runtime']['settingsManager'].shutdownDriver('inputDriver')
|
self.env['runtime']['settingsManager'].shutdownDriver('inputDriver')
|
||||||
|
|
||||||
def getInputEvent(self):
|
def getInputEvent(self):
|
||||||
@ -101,13 +101,16 @@ class inputManager():
|
|||||||
return False
|
return False
|
||||||
return self.setLedState
|
return self.setLedState
|
||||||
|
|
||||||
def grabDevices(self):
|
def grabAllDevices(self):
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'):
|
||||||
self.env['runtime']['inputDriver'].grabDevices()
|
self.env['runtime']['inputDriver'].grabAllDevices()
|
||||||
|
|
||||||
def releaseDevices(self):
|
def updateInputDevices(self):
|
||||||
|
self.env['runtime']['inputDriver'].updateInputDevices()
|
||||||
|
|
||||||
|
def removeAllDevices(self):
|
||||||
try:
|
try:
|
||||||
self.env['runtime']['inputDriver'].releaseDevices()
|
self.env['runtime']['inputDriver'].removeAllDevices()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user