From 997b6336aa5dc64f056aef4f1a44601e9bf6a695 Mon Sep 17 00:00:00 2001 From: Mendel Greenberg Date: Fri, 23 Oct 2020 14:13:55 -0400 Subject: [PATCH] Read multiple devices --- remarkable_mouse/remarkable_mouse.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/remarkable_mouse/remarkable_mouse.py b/remarkable_mouse/remarkable_mouse.py index 92f348d..23b94ca 100755 --- a/remarkable_mouse/remarkable_mouse.py +++ b/remarkable_mouse/remarkable_mouse.py @@ -69,11 +69,16 @@ def open_remote_device(args, file='/dev/input/event0'): paramiko.agent.AgentRequestHandler(session) # Start reading events - _, stdout, _ = client.exec_command('cat ' + file) + _, pen, _ = client.exec_command('cat ' + file) + _, mt, _ = client.exec_command('cat /dev/input/event1') + _, btn, _ = client.exec_command('cat /dev/input/event2') + pen.channel.setblocking(0) + mt.channel.setblocking(0) + btn.channel.setblocking(0) print("connected to", args.address) - return stdout + return pen, mt, btn def main():