initial key handling
This commit is contained in:
@ -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 = {
|
||||
|
@ -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))
|
||||
|
||||
|
Reference in New Issue
Block a user