Evidlo / remarkable_mouse

use your reMarkable as a graphics tablet
GNU General Public License v3.0
506 stars 48 forks source link

--evdev: pen doesn't work with RM2 #50

Open akdor1154 opened 3 years ago

akdor1154 commented 3 years ago

Hi, Thanks for this awesome project. I can't get --evdev to give me any pen input. Without --evdev everything seems to work OK, but with it I get touch events but no pen events. GIMP seems to recognize a pen input device being created but remouse --debug doesn't yield any event spam.

Ubuntu 20.10 Remarkable 2, latest firmware

rm2 branch

--debug output:

sudo -E ~/.local/bin/remouse --key ~/.ssh/id_rsa  --debug --monitor 1 --orientation left --evdev                             
Debugging enabled...
Connecting to input '10.11.99.1'
Pen:/dev/input/event1
Touch:/dev/input/event2
Button:/dev/input/event0
Connected to 10.11.99.1
Created virtual input device '/dev/input/event21'
Chose monitor: Monitor(x=0, y=0, width=1920, height=1200, width_mm=518, height_mm=324, name='DVI-D-0')
Wacom tablet area: 0.0 1310.3125000000002 20967.0 14414.687500000002
Multi-touch area: 63.81249999999999 0.0 703.1875 1023.0

SSH'd to the rm2, running xxd /dev/input/event1 seems to produce output from the pen as expected (though I can't interpret what it's saying because I'm not Keanu Reeves...)

I will have a play around as well, just touching base. :)

Jarrad

akdor1154 commented 3 years ago

I guess something to do with evdev.py#287 where you only read touch and button events.. this seems intentional because when I loop through all events it works for a second or two and then breaks my PC input. I'll leave this alone for now assuming you know this doesn't work yet.

EDIT: Couldn't leave it alone :) when I change the loop to just process the pen input device then it seems to work perfectly! Though obviously touch and button do nothing.

andrewhowdencom commented 3 years ago

I also did this! It also worked. Dope!

malinkb commented 3 years ago

EDIT: Couldn't leave it alone :) when I change the loop to just process the pen input device then it seems to work perfectly! Though obviously touch and button do nothing.

Hi. How exactly did you do that? :)

twitwi commented 2 years ago

For reference, I have the same issue with RM1 not working with evdev. Installing the rm2 branch with python3 -m pip install -U git+https://github.com/Evidlo/remarkable_mouse.git@rm2 yields the same problem.

Guessing from the comment above, I experimented with changing the indicated line https://github.com/Evidlo/remarkable_mouse/blob/rm2/remarkable_mouse/evdev.py#L287 I finally got something working with 0:1 instead of 1:2. (I directly modified evdev.py after installation, that you should be able to find with echo $(realpath $(dirname $(which remouse))/../lib/python*/site-packages/remarkable_mouse/evdev.py) )

@malinkb in case it is still useful for you