flxzt / rnote

Sketch and take handwritten notes.
https://rnote.flxzt.net
GNU General Public License v3.0
7.81k stars 263 forks source link

Stylus buttons do not get recognized with certain HP & Wacom pens #243

Open xkevio opened 2 years ago

xkevio commented 2 years ago

Describe the bug: The two extra buttons on my stylus do not get recognized correctly within Rnote even though they are configured in the settings to either switch to the eraser or selection tool.

When pressing the primary stylus button, nothing happens. When pressing the secondary stylus button, it moves the canvas or rather stops using the brush.

I tested the input with $ libinput debug-events and that seems to only recognize me pressing the secondary button. $ libinput list-devices also does not recognize the extra eraser device whereas xinput does.

The stylus in question is the HP Pen (1MR94AA) and I use the i3-gaps compositor on Manjaro Linux. libinput and libwaycom are installed. Weirdly, the primary stylus button works in Xournal++.

xinput recognizes my stylus as two pointers, one pen and one eraser:

$ xinput                                                                                  
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SYNA328B:00 06CB:CD50 Mouse               id=10   [slave  pointer  (2)]
⎜   ↳ SYNA328B:00 06CB:CD50 Touchpad            id=11   [slave  pointer  (2)]
⎜   ↳ ELAN2514:00 04F3:23DD                     id=12   [slave  pointer  (2)]
⎜   ↳ ELAN2514:00 04F3:23DD Stylus Pen (0)      id=19   [slave  pointer  (2)]
⎜   ↳ ELAN2514:00 04F3:23DD Stylus Eraser (0)   id=20   [slave  pointer  (2)]

Furthermore, the settings when looked at with xinput list-props [id] look as follows for both:

$ xinput list-props 19                                                                
Device 'ELAN2514:00 04F3:23DD Stylus Pen (0)':
    Device Enabled (178):   1
    Coordinate Transformation Matrix (180): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    libinput Send Events Modes Available (294): 1, 0
    libinput Send Events Mode Enabled (295):    0, 0
    libinput Send Events Mode Enabled Default (296):    0, 0
    Device Node (297):  "/dev/input/event11"
    Device Product ID (298):    1267, 9181
    libinput Tablet Tool Pressurecurve (560):   0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000, 1.000000

Desktop (please complete the following information):

schuhva commented 1 year ago

Hi Exactly same problem here. In addition, I have no pressure sensitivity as well. Buttons and sensitivity are working fine in Xournal++.

As described above xinput has an Stylus Eraser but libinput list-devices has none. With libinput debug-events I was nevertheless able to track eraser logs. (see log below)

Behaviour is identical with the BAMBOO Ink Plus and HP Pen (1MR94AA) on my HP Pavillion.

Device and Desktop HP Pavillion 14-dh1904nz with MPP (Microsoft Pen Protocol) without tilt recognition OS: Linux Mint 21 with Cinnamon desktop


Eraser button log (first button):

$ sudo libinput debug-events

...  (pen far from Display)
 event14  TABLET_TOOL_PROXIMITY   +5.748s       210.50*/140.86* pressure: 0.00* pen      (0, id 0) proximity-in     axes:p  btn:S
 event14  TABLET_TOOL_AXIS        +7.653s       210.69*/140.91* pressure: 0.00
...  (pen hovering over Display)
 event14  TABLET_TOOL_AXIS        +7.764s       211.40*/142.33* pressure: 0.00
 event14  TABLET_TOOL_AXIS        +7.773s       211.42*/142.52* pressure: 0.00
 event14  TABLET_TOOL_TIP         +7.779s       211.40*/145.03* pressure: 0.03* down
 event14  TABLET_TOOL_AXIS        +7.794s       211.40/145.03   pressure: 0.05*
 event14  TABLET_TOOL_AXIS        +7.803s       211.40/145.03   pressure: 0.07*
 ... (pen touching Display)
 event14  TABLET_TOOL_AXIS        +7.957s       210.85*/144.62* pressure: 0.30
 event14  TABLET_TOOL_AXIS        +7.959s       210.73*/144.38* pressure: 0.05*
 event14  TABLET_TOOL_TIP         +7.968s       210.48*/143.86* pressure: 0.00* up
 event14  TABLET_TOOL_AXIS        +8.028s       210.47*/143.66* pressure: 0.00
...  (pen hovering over Display)
 event14  TABLET_TOOL_AXIS        +16.112s      212.13*/139.70* pressure: 0.00
 event14  TABLET_TOOL_AXIS        +16.946s      212.08*/139.62* pressure: 0.00
 event14  TABLET_TOOL_PROXIMITY   +17.442s      212.02/139.53   pressure: 0.00  pen      (0, id 0) proximity-out 
 event14  TABLET_TOOL_PROXIMITY   +17.448s      212.02*/139.53* pressure: 0.00* pen      (0, id 0) proximity-in     axes:p  btn:S
 event14  TABLET_TOOL_PROXIMITY   +17.457s      212.02/139.53   pressure: 0.00  pen      (0, id 0) proximity-out 
 event14  TABLET_TOOL_PROXIMITY   +17.457s      212.02*/139.53* pressure: 0.00* eraser   (0, id 0) proximity-in     axes:p  btn:S
 event14  TABLET_TOOL_AXIS        +17.622s      212.00*/139.50* pressure: 0.00
 event14  TABLET_TOOL_AXIS        +18.553s      211.98*/139.47* pressure: 0.00
...   ( pen hovering with eraser button pressed)
 event14  TABLET_TOOL_AXIS        +20.315s      212.24/138.66*  pressure: 0.00
 event14  TABLET_TOOL_PROXIMITY   +20.369s      212.24/138.55   pressure: 0.00  eraser   (0, id 0) proximity-out 
 event14  TABLET_TOOL_PROXIMITY   +20.375s      212.24*/138.55* pressure: 0.00* pen      (0, id 0) proximity-in     axes:p  btn:S
 event14  TABLET_TOOL_AXIS        +20.465s      212.24/138.52*  pressure: 0.00
 event14  TABLET_TOOL_AXIS        +20.504s      212.24/138.48*  pressure: 0.00
...  ( pen hovering without button pressed)
 event14  TABLET_TOOL_AXIS        +23.372s      211.26*/138.48* pressure: 0.00
 event14  TABLET_TOOL_PROXIMITY   +23.627s      211.15/138.58   pressure: 0.00  pen      (0, id 0) proximity-out 
...  (pen far from Display)

Second button log:

... (pen hovering)
 event14  TABLET_TOOL_AXIS        +15.228s      168.82/136.72*  pressure: 0.00
 event14  TABLET_TOOL_AXIS        +15.267s      168.82/136.64*  pressure: 0.00
 event14  TABLET_TOOL_BUTTON      +15.312s  331 (BTN_STYLUS) pressed, seat count: 1
 event14  TABLET_TOOL_AXIS        +15.432s      168.82/136.53*  pressure: 0.00
 event14  TABLET_TOOL_AXIS        +15.498s      168.82/136.47*  pressure: 0.00
 event14  TABLET_TOOL_BUTTON      +15.927s  331 (BTN_STYLUS) released, seat count: 0
 event14  TABLET_TOOL_AXIS        +16.173s      168.81*/136.41* pressure: 0.00
 event14  TABLET_TOOL_AXIS        +16.753s      168.77*/136.44* pressure: 0.00
...
Quoteme commented 1 year ago

Exactly the same as @schuhva said. No pressure. Panning works using the middle button of my Bamboo Ink (not plus) digital pen. The first button (eraser) does not work, however.

output of `xinput --list` ``` ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Asus Keyboard id=10 [slave pointer (2)] ⎜ ↳ ELAN9008:00 04F3:2C82 id=13 [slave pointer (2)] ⎜ ↳ ELAN1201:00 04F3:3098 Mouse id=15 [slave pointer (2)] ⎜ ↳ ELAN1201:00 04F3:3098 Touchpad id=16 [slave pointer (2)] ⎜ ↳ ELAN9008:00 04F3:2C82 Stylus Pen (0) id=19 [slave pointer (2)] ⎜ ↳ ELAN9008:00 04F3:2C82 Stylus Eraser (0) id=20 [slave pointer (2)] ```
``` Device: Asus Wireless Radio Control Kernel: /dev/input/event0 Group: 1 Seat: seat0, default Capabilities: keyboard 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: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: Video Bus Kernel: /dev/input/event4 Group: 2 Seat: seat0, default Capabilities: keyboard 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: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: Lid Switch Kernel: /dev/input/event1 Group: 3 Seat: seat0, default Capabilities: switch 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: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: Power Button Kernel: /dev/input/event2 Group: 4 Seat: seat0, default Capabilities: keyboard 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: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: Sleep Button Kernel: /dev/input/event3 Group: 5 Seat: seat0, default Capabilities: keyboard 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: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: Asus Keyboard Kernel: /dev/input/event8 Group: 6 Seat: seat0, default Capabilities: keyboard pointer Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: disabled Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: Asus Keyboard Kernel: /dev/input/event9 Group: 6 Seat: seat0, default Capabilities: keyboard 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: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: USB2.0 HD UVC WebCam: USB2.0 HD Kernel: /dev/input/event19 Group: 7 Seat: seat0, default Capabilities: keyboard 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: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: ELAN9008:00 04F3:2C82 Kernel: /dev/input/event12 Group: 8 Seat: seat0, default Size: 284x188mm 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: ELAN9008:00 04F3:2C82 Stylus Kernel: /dev/input/event15 Group: 8 Seat: seat0, default Size: 289x180mm 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 Device: ELAN1201:00 04F3:3098 Mouse Kernel: /dev/input/event10 Group: 9 Seat: seat0, default Capabilities: pointer Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: disabled Nat.scrolling: disabled Middle emulation: n/a Calibration: n/a Scroll methods: *button Click methods: none Disable-w-typing: n/a Accel profiles: flat *adaptive Rotation: n/a Device: ELAN1201:00 04F3:3098 Touchpad Kernel: /dev/input/event11 Group: 9 Seat: seat0, default Size: 103x59mm Capabilities: pointer gesture Tap-to-click: disabled Tap-and-drag: enabled Tap drag lock: disabled Left-handed: disabled Nat.scrolling: disabled Middle emulation: disabled Calibration: n/a Scroll methods: *two-finger edge Click methods: *button-areas clickfinger Disable-w-typing: enabled Accel profiles: flat *adaptive Rotation: n/a Device: Asus WMI hotkeys Kernel: /dev/input/event20 Group: 10 Seat: seat0, default Capabilities: keyboard 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: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a ``` Output of `libinput list-devices`

I assume this is because my Wacom Bamboo Ink pen only gets listed in libinput as one device (not as three separate ones?)

My suggestion would be to add a setting to toggle between using xinput and libinput. Waiting for libinput to fix this seems like a bad idea.

@xkevio Mind chaning the title to "Stylus buttons and pressure do not get recognized with certain pens (HP&Wacom)"?

schuhva commented 1 year ago

Update to pen support: For other reasons, I have installed Fedora 37 with Gnome 43.2 and Wayland, with pressure sensitivity and eraser working just fine. (on the same laptop) On my earlier comment I tested rnote with Linux Mint using Cinnamon desktop with X11. When switching to gnome X11 Session in Fedora, there is no Pressure sensitivity and eraser. Therefore, it is probably a similar or same problem as issues #194

Quoteme commented 1 year ago

@schuhva I can confirm this. On Wayland all buttons work. The problems only arise on X11.

hcsch commented 1 year ago

Not sure if this is the same issue or a separate one, but with my Dell Active Pen PN579X the primary button also does nothing in Rnote, while the secondary button is recognized as the primary one. I have Button 1 set to "Default" in GNOME 44.0 Wayland. libinput debug-events shows me TABLET_TOOL_PROXIMITY events switching between pen and eraser when the primary button on the pen is pressed, and TABLET_TOOL_BUTTON events (331 (BTN_STYLUS)) for the secondary button. The pen works as-intended in the "Test your Settings" panel in GNOME Settings. libinput list-devices shows a Wacom HID 486A Pen. In case it helps, Xournal++ recognizes the secondary button as "Button 2", "Button 1" is not mapped, and the primary button on the pen is recognized as the eraser. Same behaviour as @schuhva has observed with their pen, as far as I can tell.

jackyohh commented 11 months ago

I have Dell Active Pen PN579X too but working on Win10. Almost same beviour like above (@hcsch ). 2nd Button is recognized as Button 1. But 2nd Button is always configured as <temporary - forms>. Can't change this in rnote settings. Dell Drivers are installed and Buttons are configured in "Dell Active Pen" software. Xournal++ is working fine with my Pen.

BTW Rnote is so AMAZING! Clean userinterface with quick handling!! THX dev Team!!!!

TheOnlyJoey commented 1 month ago

I am using a cheap Lab31 'USTP03' pen that has the same behavior, this is on GNOME 46 on Wayland. (ASUS Chromebook with AMD Ryzen 3 7320C running Debian)

In Rnote it just only scrolls, there is no way to do a simple remap in the settings it seems. Xournal and Gimp work properly.

Doublonmousse commented 1 month ago

@TheOnlyJoey This pen is not an active pen so it actually mimics a finger touching the screen (and thus sends touch events, not pen events).

You have to activate draw with touch input to get it to work. It is to note you won't be able to get the full functionality of an active pen with this (no way to get palm rejection or distinguish a touch event from a pen event)