grab/ungrab on noKeyPressed()
This commit is contained in:
parent
26fcd92f81
commit
abc449bec2
@ -12,6 +12,7 @@ class screenManager():
|
||||
def __init__(self):
|
||||
self.currScreenIgnored = False
|
||||
self.prevScreenIgnored = False
|
||||
self.toggleDeviceGrab = False
|
||||
def initialize(self, environment):
|
||||
self.env = environment
|
||||
self.env['runtime']['settingsManager'].loadDriver(\
|
||||
@ -40,15 +41,22 @@ class screenManager():
|
||||
if not self.isSuspendingScreen(self.env['screen']['newTTY']):
|
||||
self.update(eventData, 'onScreenChange')
|
||||
self.env['screen']['lastScreenUpdate'] = time.time()
|
||||
def handleDeviceGrab(self):
|
||||
if self.getCurrScreenIgnored() != self.getPrevScreenIgnored():
|
||||
self.toggleDeviceGrab = True
|
||||
if self.toggleDeviceGrab:
|
||||
if self.env['runtime']['inputManager'].noKeyPressed():
|
||||
if self.getCurrScreenIgnored():
|
||||
self.env['runtime']['inputManager'].ungrabAllDevices()
|
||||
self.env['runtime']['outputManager'].interruptOutput()
|
||||
else:
|
||||
self.env['runtime']['inputManager'].grabAllDevices()
|
||||
self.toggleDeviceGrab = True
|
||||
|
||||
def handleScreenUpdate(self, eventData):
|
||||
self.env['screen']['oldApplication'] = self.env['screen']['newApplication']
|
||||
self.updateScreenIgnored()
|
||||
if self.getCurrScreenIgnored() != self.getPrevScreenIgnored():
|
||||
if self.getCurrScreenIgnored():
|
||||
self.env['runtime']['inputManager'].ungrabAllDevices()
|
||||
self.env['runtime']['outputManager'].interruptOutput()
|
||||
else:
|
||||
self.env['runtime']['inputManager'].grabAllDevices()
|
||||
self.handleDeviceGrab()
|
||||
if not self.getCurrScreenIgnored():
|
||||
self.update(eventData, 'onScreenUpdate')
|
||||
#if trigger == 'onUpdate' or self.isScreenChange() \
|
||||
|
Loading…
Reference in New Issue
Block a user