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

Support usb:056A:50B8 for Lenovo ThinkPad X1 Yoga 2nd-gen #12

Closed
jigpu opened this issue Jan 8, 2018 · 8 comments
Closed

Support usb:056A:50B8 for Lenovo ThinkPad X1 Yoga 2nd-gen #12

jigpu opened this issue Jan 8, 2018 · 8 comments

Comments

@jigpu
Copy link
Member

jigpu commented Jan 8, 2018

See linuxwacom/wacom-hid-descriptors#17 for system information.

jigpu added a commit that referenced this issue Jan 8, 2018
#12

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
@jigpu jigpu closed this as completed Jan 9, 2018
@joanpau
Copy link

joanpau commented Sep 11, 2019

With gnome-control-center 3.30 and libwacom 0.32 (from debian testing),
the device appears as a tablet in the section 'Wacom Graphic Tablet', and works pretty well
(although the calibration is broken in that version).
However no stylus pen appears in that menu,
so the functions of the buttons can not be checked/configured
and only one button seems to be recognized (tested using gtk3-demo).
This is similar to the problem described in linuxwacom/wacom-hid-descriptors#17
Is this commit already merged in that release?
(I could not determine it from the changelogs in the releases page).
Should this bug be filled somewhere else?

@jigpu
Copy link
Member Author

jigpu commented Sep 11, 2019

The tablet definition was added into libwacom 0.29, and is a part of your release. The issue of the stylus not appearing is likely due to GNOME requiring an additional stylus definition for your tablet (see e.g. #57, #128, #149).

Please use our capture.sh script to record a single stroke with your pen and then attach the generated tarball here.

@joanpau
Copy link

joanpau commented Sep 11, 2019

The script fails because there is no X server:

# ./capture.sh 
Unable to connect to X server

May it be because of the calls to xinput?
In that case the script might be adapted to use the output of libinput instead:

# libinput list-devices
Device:           Wacom Pen and multitouch sensor Finger
Kernel:           /dev/input/event7
Group:            5
Seat:             seat0, default
Size:             309x174mm
Capabilities:     touch 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    n/a
Middle emulation: n/a
Calibration:      identity matrix
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   n/a
Rotation:         n/a

Device:           Wacom Pen and multitouch sensor Pen
Kernel:           /dev/input/event9
Group:            5
Seat:             seat0, default
Size:             309x174mm
Capabilities:     tablet 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    n/a
Middle emulation: n/a
Calibration:      identity matrix
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   none
Rotation:         n/a

Since I don't know what's the output of xinput list-props in line 130 I am not sure though.

By the way in gtk3-demo the pen is reported with serial 98d1b9ea.

@jigpu
Copy link
Member Author

jigpu commented Sep 11, 2019

The most important data that it captures for this purpose is the output of evemu-record. It will contain the tool ID information reported from the device/kernel. Use sudo apt-get install evemu-tools to install the program and then run sudo evemu-record > pen.log. Choose the Wacom device from the list (it should have "50B8" in its name) and then make a stroke with the pen. Press CTRL+C when done and attach the log file here.

@joanpau
Copy link

joanpau commented Sep 12, 2019

This is the log recorded by sudo evemu-record > pen.log
pen.log

@jigpu
Copy link
Member Author

jigpu commented Sep 13, 2019

Thanks. Looks like the ID for your pen is 0x11. Try adding the following to the end of your /usr/share/libwacom/libwacom.stylus file:

[0x11]
Name=Lenvovo AES Pen
Buttons=1
HasEraser=false
Axes=Tilt;Pressure
Type=General

And editing your /usr/share/libwacom/isdv4-50b8.tablet file to add the following line under the [Device] section:

Styli=0x11

Afterwards, reboot.

@joanpau
Copy link

joanpau commented Sep 15, 2019

Thanks.
With that stylus definition, the pen appears now in gnome settings with a single button.
The pen has actually two buttons at the side:
the bottom one acts as eraser, and the function of the top one is unknown to me.
I notice that the stylus definition specifies Buttons=1 and HasEraser=false. Is that right?
Reconfiguring the button shown in the control center to act as a middle or right button click
does not change the behavior of any of the buttons.

I recorded one pen stroke with each button pressed:
pen_top_button.log
pen_bottom_button.log
The bottom one seems to appear as EV_KEY / BTN_TOOL_RUBBER
and the top one seems to appear as EV_KEY / BTN_STYLUS
(I am not sure, though, because I don't know what to look for).

For the sake of curiosity, I set Buttons=2 in the pen definition.
With that, the bottom button acts as an eraser whatever function it has assigned in the control center.
The top button acts as a middle button click when set to right button click (weird), otherwise does nothing.

Is this a problem in libwacom or some other component of Gnome?
How many buttons should the stylus definition set?

@jigpu
Copy link
Member Author

jigpu commented Sep 18, 2019

The Buttons=1 was intentional since (as you've observed) the other button is an eraser switch rather than a programmable button. Based on your observations, however, it seems like GNOME does not properly handle it. You can definitely use Buttons=2 in the interim if it works better, but it sounds like there are some GNOME issues that need to be worked out.

The HasEraser=false was completely unintentional. You can change it to HasEraser=true since that second button acts as a de-facto eraser.

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

No branches or pull requests

2 participants