make fenrir useable with mouse and other nonwatched input events
This commit is contained in:
parent
dec8b41b18
commit
932034b560
@ -51,16 +51,30 @@ class driver():
|
|||||||
if r != []:
|
if r != []:
|
||||||
for fd in r:
|
for fd in r:
|
||||||
event = self.iDevices[fd].read_one()
|
event = self.iDevices[fd].read_one()
|
||||||
|
foreward = False
|
||||||
while(event):
|
while(event):
|
||||||
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.type == evdev.events.EV_KEY:
|
if event.type == evdev.events.EV_KEY:
|
||||||
if event.code != 0:
|
if event.code != 0:
|
||||||
currMapEvent = self.env['runtime']['inputDriver'].mapEvent(event)
|
currMapEvent = self.mapEvent(event)
|
||||||
if not currMapEvent:
|
if not currMapEvent:
|
||||||
return currMapEvent
|
foreward = True
|
||||||
|
event = self.iDevices[fd].read_one()
|
||||||
|
continue
|
||||||
|
if not isinstance(currMapEvent['EventName'], str):
|
||||||
|
foreward = True
|
||||||
|
event = self.iDevices[fd].read_one()
|
||||||
|
continue
|
||||||
|
if not foreward:
|
||||||
if currMapEvent['EventState'] in [0,1,2]:
|
if currMapEvent['EventState'] in [0,1,2]:
|
||||||
return currMapEvent
|
return currMapEvent
|
||||||
|
else:
|
||||||
|
if not event.type in [0,1,4]:
|
||||||
|
foreward = True
|
||||||
event = self.iDevices[fd].read_one()
|
event = self.iDevices[fd].read_one()
|
||||||
|
if foreward:
|
||||||
|
self.writeEventBuffer()
|
||||||
|
self.clearEventBuffer()
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def writeEventBuffer(self):
|
def writeEventBuffer(self):
|
||||||
|
@ -15,6 +15,6 @@ while True:
|
|||||||
if r != []:
|
if r != []:
|
||||||
for fd in r:
|
for fd in r:
|
||||||
for event in devices[fd].read():
|
for event in devices[fd].read():
|
||||||
print('Devicename:'+ devices[fd].name + ' Devicepath:' + devices[fd].fn + ' Events:' + str(devices[fd].active_keys(verbose=True)) + ' Value:' + str(event.value))
|
print('Devicename:'+ devices[fd].name + ' Devicepath:' + devices[fd].fn + ' EventType: ' + str(event.type) + ' Events:' + str(devices[fd].active_keys(verbose=True)) + ' Value:' + str(event.value))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user