Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evdev: libinput ignores the events because tablet resolution is missing #18

Closed
skadge opened this issue Jan 21, 2020 · 8 comments · Fixed by #33
Closed

evdev: libinput ignores the events because tablet resolution is missing #18

skadge opened this issue Jan 21, 2020 · 8 comments · Fixed by #33

Comments

@skadge
Copy link

skadge commented Jan 21, 2020

Step to reproduce on Ubuntu 19.10, running wayland:

  • start remouse like that:
$ sudo remouse --evdev --key ~/.ssh/remarkable
Created virtual input device '/dev/input/event5'
  • no virtual tablet is created/visible

  • Running libinput list-devices return the following error:

$ sudo libinput list-devices
event5  - reMarkable tablet: libinput bug: missing tablet capabilities: resolution. Ignoring this device.

According to libinput documentation, we need to specify the resolution of the tablet in a 60-evdev.hwdb entry.

@skadge
Copy link
Author

skadge commented Jan 21, 2020

Adding the following lines to /lib/udev/hwdb.d/60-evdev.hwdb:

evdev:input:b0018v056Ap0000*
 EVDEV_ABS_00=::20
 EVDEV_ABS_01=::20

Followed by:

$ sudo systemd-hwdb update
$ sudo udevadm trigger /dev/input/event5

And finally restarting remouse fixes the problem.

Two important notes:

  • the value after evdev:input is the modalias of the tablet. You might want to check how it appears on your system: cat /sys/devices/virtual/input/input58/modalias
  • I'm not sure about the actual resolution of the tablet, but 20 units/mm seems not too far off (the resulting behaviour of the tablet was ok)

@chabad360
Copy link
Contributor

chabad360 commented Oct 22, 2020

I hate to be a bother, but I'm having this issue as well and it's been a while since this was touched.

@Evidlo
Copy link
Owner

Evidlo commented Oct 22, 2020

Maybe something like this is the right approach?

Can someome try adding this in evdev.py?

device.absinfo[libevdev.EV_ABS.ABS_X] = InputAbsInfo(resolution=2531)
device.absinfo[libevdev.EV_ABS.ABS_Y] = InputAbsInfo(resolution=2531)

Not sure if these resolutions are correct. In the example it seems like the resolution is in dpi, which I manually computed. Does the error go away at least?

@chabad360
Copy link
Contributor

Where would I put it?

@Evidlo
Copy link
Owner

Evidlo commented Oct 23, 2020 via email

@chabad360
Copy link
Contributor

chabad360 commented Oct 23, 2020

I stuck it over here:

...
   # Enable position, tilt, distance and pressure change events
    device.enable(
        libevdev.EV_ABS.ABS_X,
        libevdev.InputAbsInfo(
            minimum=0,
            maximum=MAX_ABS_X,
            resolution=2531 # <----
        )
    )
    device.enable(
        libevdev.EV_ABS.ABS_Y,
        libevdev.InputAbsInfo(
            minimum=0,
            maximum=MAX_ABS_Y,
            resolution=2531 # <----
        )
    )
...

@chabad360
Copy link
Contributor

Further testing revealed a slight lack of alignment, but that was fixed with --mode fill. So it seems to have worked (yay)!

chabad360 added a commit to chabad360/remarkable_mouse that referenced this issue Oct 23, 2020
@chabad360 chabad360 mentioned this issue Oct 23, 2020
Evidlo added a commit that referenced this issue Oct 25, 2020
@chabad360
Copy link
Contributor

@Evidlo mmm... it seems like the alignment issues persist, so either the resolution is wrong, or there is something wrong with remap()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants