8

I just bought a Lenovo ThinkPad X1 Yoga, which has a Wacom touchscreen and stylus.

They both work well-ish, but I want to remap buttons on the pen and the long press behavior. In previous Ubuntu releases you could just go to Wacom tablet in settings and change everything there, but now it says I don't have neither a stylus or a tablet. It's funny that the Test my settings popup actually detects the stylus

No stylus found

No tablet detected

"Test my settings" dialog, it works

xinput shows all the input devices correctly:

$ xinput
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Wacom Co.,Ltd. Pen and multitouch sensor Finger   id=9    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=13   [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                     id=14   [slave  pointer  (2)]
⎜   ↳ Wacom Co.,Ltd. Pen and multitouch sensor Pen Pen (0)  id=16   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Sleep Button                              id=8    [slave  keyboard (3)]
    ↳ Wacom Co.,Ltd. Pen and multitouch sensor Pen  id=10   [slave  keyboard (3)]
    ↳ Integrated Camera                         id=11   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=12   [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                    id=15   [slave  keyboard (3)]

It seems it's using libinput for everything (and I think that may be the issue):

$ journalctl --boot | grep -e "Using input driver 'libinput'"
(II) Using input driver 'libinput' for 'Power Button'
(II) Using input driver 'libinput' for 'Video Bus'
(II) Using input driver 'libinput' for 'Sleep Button'
(II) Using input driver 'libinput' for 'Wacom Co.,Ltd. Pen and multitouch sensor Finger'
(II) Using input driver 'libinput' for 'Wacom Co.,Ltd. Pen and multitouch sensor Pen'
(II) Using input driver 'libinput' for 'Integrated Camera'
(II) Using input driver 'libinput' for 'AT Translated Set 2 keyboard'
(II) Using input driver 'libinput' for 'SynPS/2 Synaptics TouchPad'
(II) Using input driver 'libinput' for 'TPPS/2 IBM TrackPoint'
(II) Using input driver 'libinput' for 'ThinkPad Extra Buttons'
(II) Using input driver 'libinput' for 'Wacom Co.,Ltd. Pen and multitouch sensor Pen Pen (0)'
(II) Using input driver 'libinput' for 'Wacom Co.,Ltd. Pen and multitouch sensor Pen Eraser (0x96d2bb6c'

Note that I tried to install the old xserver-xorg-input-wacom but touchscreen wouldn't work anymore (just the pen), and configuration in settings didn't work anyway. A friend of mine, who could configure it just fine on Ubuntu 16.04, after upgrading is having the same issue on an HP convertible laptop.

Is there any other way I can remap buttons and configure its behavior?

depau
  • 229

2 Answers2

1

At the end of the day, this is what I eventually found out that:

  • Layout data for tablets and styluses is handled by the Linux Wacom project and should be contributed to them if it's missing. It includes all the information about the devices, such as the number of buttons.
  • Data for new tablets, once somebody contributes it, is eventually packaged into distros after some time. In fact, the Wacom settings page for my tablet worked since Ubuntu 18.04.
  • Configuration for input devices on Xorg (using libinput) is managed with the xinput tool. By running xinput --list-props <device>, all available settings are listed, and can be configured.
  • On Wayland, everything is more complicated: the input configuration, just as every other display/HID-related setting, is managed by the compositor.
    • GNOME manages them with gsettings: you can see the configuration with dconf-editor inside /org/gnome/desktop/peripherals. GNOME Settings does its work by changing stuff there.
    • On Weston you must change the configuration file (source).
    • Other compositors may behave differently.

Eventually I haven't managed to configure my stylus, but I think it's the stylus' fault: it has two buttons but they're actually not remappable: one acts as the eraser, the other one works as a button. They can't be swapped.

depau
  • 229
0

TBH, I'm not sure how libinput relates to this situation. Here are some ideas that could help.

Xsetwacom is present on Ubuntu 17.04. Xsetwacom remaps the buttons a layer down in the stack, in the Wacom X driver, bypassing the need to use gnome for remappings. I tested xsetwacom on 17.04 with an opaque tablet and was able to remap the buttons. I don't have a Yoga to test with, but if xsetwacom -s get "Your device name from xsetwacom list" all

shows the properties of your device, you should be able to set them with xsetwacom.

Another idea, this commit [1] adds some Yoga devices to libwacom. So, if you want your device to show up in the control panel, you may need to update your libwacom. Right now you'd need to do that from that git repository [2] since there hasn't been a release yet that includes those changes.

[1] https://sourceforge.net/p/linuxwacom/libwacom/ci/3b37fe15814cfa4c0ed72722edb0225d18563c5c/ [2] http://linuxwacom.sourceforge.net/wiki/index.php/Libwacom