From 95cbb14602ce6816c94b870c17734a7f773fcdd4 Mon Sep 17 00:00:00 2001 From: Andrew Somerville Date: Sun, 10 May 2020 03:37:35 -0400 Subject: [PATCH 1/2] fix: change device description to work better with gnome/gdk/mutter/gnome-control-center/ubuntu. 'pen' in the name was apparently important --- remarkable_mouse/evdev.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/remarkable_mouse/evdev.py b/remarkable_mouse/evdev.py index 5e2c793..f3f983b 100644 --- a/remarkable_mouse/evdev.py +++ b/remarkable_mouse/evdev.py @@ -22,13 +22,21 @@ def create_local_device(): import libevdev device = libevdev.Device() - # Set device properties to emulate those of Wacom tablets - device.name = 'reMarkable tablet' + # Set device properties to emulate those of Wacom tablet. + # "pen" or "wacom" must be in the name or gdk will treat us as a TOUCHSCREEN device + # rather than a PEN device. + # + # Then "Mutter", which is responsible for doing the input mapping will silently + # refuse to map our device when requested in gnome-control-center + # + # (see https://gitlab.gnome.org/GNOME/gtk/blob/master/gdk/x11/gdkdevicemanager-xi2.c) + # (See https://gitlab.gnome.org/GNOME/mutter/-/blob/master/src/backends/meta-input-settings.c) + device.name = 'reMarkable pen' # keep "pen" ! device.id = { - 'bustype': 0x18, # i2c - 'vendor': 0x056a, # wacom - 'product': 0, - 'version': 54 + 'bustype': 0x03, # usb though this is pretend and only for matching + 'vendor': 0x056a, # wacom since input systems will look for this and match x driver + 'product': 0x04, # no collision https://www.the-sz.com/products/usbid/index.php?v=0x056A + 'version': 0 # I don't think this matters } # Enable buttons supported by the digitizer From 6a7251fa10415a57c649a1823cf600cb771c987d Mon Sep 17 00:00:00 2001 From: Andrew Somerville Date: Sun, 10 May 2020 04:04:28 -0400 Subject: [PATCH 2/2] feat: enable normal 'Wacom Tablet' configuration in gnome-control-center --- README.md | 5 +++++ remarkable.tablet | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 remarkable.tablet diff --git a/README.md b/README.md index 46bcdd8..db5f8ab 100644 --- a/README.md +++ b/README.md @@ -52,3 +52,8 @@ remouse --key ~/.ssh/remarkable stylus pressure threshold (default 1000) --evdev use evdev to support pen tilt (requires root, no OSX support) + +# Integration + +To get gnome control center to treat remarkable-mouse as a wacom tablet, copy [remarkable.tablet](./remarkable.tablet) into `/usr/share/libwacom/` +Once copied, `libwacom-list-local-devices` should show `'reMarkable tablet 1'` whenever `remarkable-mouse` is running using the `--evdev` option. `gnome-control-center` (aka gnome settings) will show remarkable in `Devices > Wacom Tablet` and allow you to easily map to a monitor, change the rotation, etc. diff --git a/remarkable.tablet b/remarkable.tablet new file mode 100644 index 0000000..8c3f6d9 --- /dev/null +++ b/remarkable.tablet @@ -0,0 +1,29 @@ +# reMarkable +# +# Button Map: TODO +# +# Default button assignments: TODO +# +# stylus with two buttons and no eraser +# Pen active area: 8.25 x 6.125 in + +[Device] +Name=reMarkable tablet 1 +DeviceMatch=usb:056a:0004 +Class=Bamboo +Width=6 +Height=8 +IntegratedIn= +#Layout= +Styli= #FIXME + +[Features] +Stylus=true +Reversible=true +Touch=false # will update when we fix this +Buttons=3 +Ring=false + +[Buttons] +Top=A;B;C +EvdevCodes=0x110;0x112;0x111 # might need tweaking