Author youngchaos
Recipients asvetlov, youngchaos, yselivanov
Date 2018-12-13.08:58:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1544691501.96.0.788709270274.issue35481@psf.upfronthosting.co.za>
In-reply-to
Content
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))
History
Date User Action Args
2018-12-13 08:58:22youngchaossetrecipients: + youngchaos, asvetlov, yselivanov
2018-12-13 08:58:21youngchaossetmessageid: <1544691501.96.0.788709270274.issue35481@psf.upfronthosting.co.za>
2018-12-13 08:58:21youngchaoslinkissue35481 messages
2018-12-13 08:58:21youngchaoscreate