New submission from youngchaos <yang...@139.com>:
import struct, asyncio, os async def readdev(dev): while True: buf=os.read(dev, 480) print([struct.unpack('llHHi', buf[i*24:(i+1)*24]) for i in range(len(buf)//24)]) mouse=os.open('/dev/input/event2', os.O_RDONLY) kbd=os.open('/dev/input/event5', os.O_RDONLY) async def main(mouse,kbd): await asyncio.gather(readdev(mouse),readdev(kbd)) asyncio.run(main(mouse,kbd)) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35481> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com