filter out unneeded events, improve interrupt commands
This commit is contained in:
parent
40b257f4e7
commit
8bedf94073
@ -16,6 +16,8 @@ class command():
|
|||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'interrupts the current presentation'
|
return 'interrupts the current presentation'
|
||||||
def run(self):
|
def run(self):
|
||||||
|
if len(self.env['input']['prevDeepestInput']) > len(self.env['input']['currInput']):
|
||||||
|
return
|
||||||
self.env['runtime']['outputManager'].interruptOutput()
|
self.env['runtime']['outputManager'].interruptOutput()
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -19,6 +19,8 @@ class command():
|
|||||||
def run(self):
|
def run(self):
|
||||||
if self.env['runtime']['inputManager'].noKeyPressed():
|
if self.env['runtime']['inputManager'].noKeyPressed():
|
||||||
return
|
return
|
||||||
|
if len(self.env['input']['prevDeepestInput']) > len(self.env['input']['currInput']):
|
||||||
|
return
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'interruptOnKeyPress'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'interruptOnKeyPress'):
|
||||||
return
|
return
|
||||||
if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']:
|
if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']:
|
||||||
|
@ -53,7 +53,6 @@ class fenrir():
|
|||||||
else:
|
else:
|
||||||
self.environment['runtime']['screenManager'].update('onInput')
|
self.environment['runtime']['screenManager'].update('onInput')
|
||||||
self.environment['runtime']['commandManager'].executeDefaultTrigger('onInput')
|
self.environment['runtime']['commandManager'].executeDefaultTrigger('onInput')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.environment['runtime']['screenManager'].update('onUpdate')
|
self.environment['runtime']['screenManager'].update('onUpdate')
|
||||||
if self.environment['runtime']['applicationManager'].isApplicationChange():
|
if self.environment['runtime']['applicationManager'].isApplicationChange():
|
||||||
|
@ -32,7 +32,11 @@ class driver():
|
|||||||
event = self.iDevices[fd].read_one()
|
event = self.iDevices[fd].read_one()
|
||||||
self.env['input']['eventBuffer'].append( [self.iDevices[fd], self.uDevices[fd], event])
|
self.env['input']['eventBuffer'].append( [self.iDevices[fd], self.uDevices[fd], event])
|
||||||
if event.code != 0:
|
if event.code != 0:
|
||||||
return self.env['runtime']['inputDriver'].mapEvent(event)
|
currMapEvent = self.env['runtime']['inputDriver'].mapEvent(event)
|
||||||
|
if not currMapEvent:
|
||||||
|
return currMapEvent
|
||||||
|
if currMapEvent['EventState'] in [0,1,2]:
|
||||||
|
return currMapEvent
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def writeEventBuffer(self):
|
def writeEventBuffer(self):
|
||||||
@ -53,8 +57,8 @@ class driver():
|
|||||||
# 1 Keys
|
# 1 Keys
|
||||||
# we try to filter out mices and other stuff here
|
# we try to filter out mices and other stuff here
|
||||||
self.iDevices = map(evdev.InputDevice, (evdev.list_devices()))
|
self.iDevices = map(evdev.InputDevice, (evdev.list_devices()))
|
||||||
self.iDevices = {dev.fd: dev for dev in self.iDevices if 1 in dev.capabilities() and not 3 in dev.capabilities() and not 2 in dev.capabilities()}
|
#self.iDevices = {dev.fd: dev for dev in self.iDevices if 1 in dev.capabilities() and not 3 in dev.capabilities() and not 2 in dev.capabilities()}
|
||||||
#self.iDevices = {dev.fd: dev for dev in self.iDevices if 1 in dev.capabilities()}
|
self.iDevices = {dev.fd: dev for dev in self.iDevices if 1 in dev.capabilities()}
|
||||||
self.ledDevices = map(evdev.InputDevice, (evdev.list_devices()))
|
self.ledDevices = map(evdev.InputDevice, (evdev.list_devices()))
|
||||||
self.ledDevices = {dev.fd: dev for dev in self.ledDevices if 1 in dev.capabilities() and 17 in dev.capabilities() and not 3 in dev.capabilities() and not 2 in dev.capabilities()}
|
self.ledDevices = {dev.fd: dev for dev in self.ledDevices if 1 in dev.capabilities() and 17 in dev.capabilities() and not 3 in dev.capabilities() and not 2 in dev.capabilities()}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user