detect device only once
This commit is contained in:
parent
7e4217254a
commit
d01d4f0773
@ -51,10 +51,13 @@ class inputManager():
|
|||||||
self.executeDeviceGrab = newExecuteDeviceGrab
|
self.executeDeviceGrab = newExecuteDeviceGrab
|
||||||
def handleDeviceGrab(self):
|
def handleDeviceGrab(self):
|
||||||
if not self.executeDeviceGrab:
|
if not self.executeDeviceGrab:
|
||||||
|
print('1')
|
||||||
return
|
return
|
||||||
if self.env['input']['eventBuffer'] != []:
|
if self.env['input']['eventBuffer'] != []:
|
||||||
|
print('2', self.env['input']['eventBuffer'])
|
||||||
return
|
return
|
||||||
if not self.noKeyPressed():
|
if not self.noKeyPressed():
|
||||||
|
print('3')
|
||||||
return
|
return
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'):
|
||||||
self.executeDeviceGrab = False
|
self.executeDeviceGrab = False
|
||||||
@ -166,7 +169,7 @@ class inputManager():
|
|||||||
return True
|
return True
|
||||||
def handlePlugInputDevice(self, eventData):
|
def handlePlugInputDevice(self, eventData):
|
||||||
for deviceEntry in eventData:
|
for deviceEntry in eventData:
|
||||||
self.env['runtime']['inputManager'].updateInputDevices(deviceEntry['device'])
|
self.updateInputDevices(deviceEntry['device'])
|
||||||
def updateInputDevices(self, newDevice = None):
|
def updateInputDevices(self, newDevice = None):
|
||||||
try:
|
try:
|
||||||
self.env['runtime']['inputDriver'].updateInputDevices(newDevice)
|
self.env['runtime']['inputDriver'].updateInputDevices(newDevice)
|
||||||
|
@ -417,6 +417,11 @@ class settingsManager():
|
|||||||
environment['runtime']['vmenuManager'].initialize(environment)
|
environment['runtime']['vmenuManager'].initialize(environment)
|
||||||
environment['runtime']['quickMenuManager'] = quickMenuManager.quickMenuManager()
|
environment['runtime']['quickMenuManager'] = quickMenuManager.quickMenuManager()
|
||||||
environment['runtime']['quickMenuManager'].initialize(environment)
|
environment['runtime']['quickMenuManager'].initialize(environment)
|
||||||
|
# only possible after having input and screen managers with clean buffer
|
||||||
|
environment['runtime']['inputManager'].setExecuteDeviceGrab()
|
||||||
|
environment['runtime']['inputManager'].writeEventBuffer()
|
||||||
|
environment['runtime']['inputManager'].handleDeviceGrab()
|
||||||
|
|
||||||
environment['runtime']['debug'].writeDebugOut('\/-------environment-------\/',debug.debugLevel.INFO, onAnyLevel=True)
|
environment['runtime']['debug'].writeDebugOut('\/-------environment-------\/',debug.debugLevel.INFO, onAnyLevel=True)
|
||||||
environment['runtime']['debug'].writeDebugOut(str(environment), debug.debugLevel.INFO, onAnyLevel=True)
|
environment['runtime']['debug'].writeDebugOut(str(environment), debug.debugLevel.INFO, onAnyLevel=True)
|
||||||
environment['runtime']['debug'].writeDebugOut('\/-------settings.conf-------\/', debug.debugLevel.INFO, onAnyLevel=True)
|
environment['runtime']['debug'].writeDebugOut('\/-------settings.conf-------\/', debug.debugLevel.INFO, onAnyLevel=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user