initial key handling

This commit is contained in:
chrys
2016-07-07 21:40:10 +02:00
parent f7fa100173
commit 5ee9dca99e
4 changed files with 32 additions and 5 deletions

View File

@ -2,9 +2,10 @@
runtime = {
'running':True,
'debug':None,
'columns': 0,
'lines': 0,
'screenDriver': '/dev/vcsa',
'screenDriver': None,
'delta': '',
'oldCursor':{'x':0,'y':0},
'oldContentBytes': b'',
@ -22,6 +23,7 @@ runtime = {
'screenDriver': None,
'soundDriverString': '',
'soundDriver': None,
'inputManager': None
}
settings = {

View File

@ -1,9 +1,24 @@
#!/bin/python
import evdev
from evdev import InputDevice
from select import select
class inputManager():
def __init__(self):
pass
self.devices = map(evdev.InputDevice, (evdev.list_devices()))
self.devices = {dev.fd: dev for dev in self.devices}
for dev in self.devices.values(): print(dev)
def getCommandQueue(self, runtime):
return[]
def getShortcutCommand(self, runtime, shortcuts):
if not shortcuts:
return ''
return ''
def getKeyPressed(self, runtime):
r, w, x = select(self.devices, [], [])
for fd in r:
for event in self.devices[fd].read():
if event.type == evdev.ecodes.EV_KEY:
print(evdev.categorize(event))