diff --git a/README.md b/README.md index 988e64c..30dfc2a 100644 --- a/README.md +++ b/README.md @@ -54,3 +54,8 @@ remouse --key ~/.ssh/remarkable --threshold THRESH stylus pressure threshold (default 600) --evdev use evdev to support pen pressure (requires root, Linux only) + +# 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 diff --git a/remarkable_mouse/evdev.py b/remarkable_mouse/evdev.py index 24709d3..ca41b3a 100644 --- a/remarkable_mouse/evdev.py +++ b/remarkable_mouse/evdev.py @@ -25,14 +25,22 @@ 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