xppen eraser not working, buttons not mapped as expected
Describe the bug
First, this may well be a config issue - but I don't see where, and namely with the pen hardware eraser, it's set as "eraser"; the XPPen driver doesn't provide much info on it's config settings or what "keycodes" the pen outputs. OpenTabletDriver doesn't yet support my tablet.
HW:
- XPPen artist pro 16 gen2 (Note: not "artist 16 pro", or "artist 16 2nd") with the stock "X3 pen"
- xppen driver
XPPen configured as follows:
XPPen button settings in their driver config app:
To Reproduce
- draw with pen: works as expected
- try to erase with the eraser end of pen - draws more lines
- "draw" with pen while holding either of the two pen buttons - just draws lines
Expected behavior
some way to make:
- the eraser erase: specifically that's be in draw mode:
- draw with the pen tip
- flip pen around and erase a line (line disappears)
- flip pen back to tip, continue drawing (no interacting with the UI necessary here
Console Output
Run the app in the terminal with flatpak --env=RUST_LOG=rnote=debug --env=RUST_BACKTRACE=1 run com.github.flxzt.rnote and post the output.
nothing is output for the actions above, error or otherwise
Screenshots
n/a
Desktop (please complete the following information):
- OS: ubuntu 20.04, X11, i3
- App Version: Rnote v0.9.0
- Installation Source: Flatpak / flathub
- Desktop Environment: defaults for 20.04 ;
gnome-shell --version == GNOME Shell 3.36.9
Additional context
ID's referenced below in comments
$ xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ ...
...
⎜ ↳ UGTABLET Artist Pro 16 (Gen2) Mouse id=10 [slave pointer (2)]
⎜ ↳ UGTABLET Artist Pro 16 (Gen2) Pen (0) id=12 [slave pointer (2)]
⎜ ↳ XP-Pen Mouse id=21 [slave pointer (2)]
⎜ ↳ XP-Pen Pen Pen (0) id=25 [slave pointer (2)]
⎜ ↳ XP-Pen Eraser Eraser (0) id=26 [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)]
↳ ...
...
↳ UGTABLET Artist Pro 16 (Gen2) Keyboard id=9 [slave keyboard (3)]
↳ UGTABLET Artist Pro 16 (Gen2) id=11 [slave keyboard (3)]
↳ XP-Pen Mouse id=22 [slave keyboard (3)]
↳ XP-Pen Eraser id=23 [slave keyboard (3)]
↳ XP-Pen Pen id=24 [slave keyboard (3)]
ID 10, 12, 21, 9, 22 don't output anything when using the pen
ID 11, 23, and 24 say no event registered in xinput test (although the buttons are definitely sending something)
ID 15 outputs the following drawing a quick short line over rnote:
motion a[0]=976653 a[1]=5339054 a[2]=0 a[3]=14 a[4]=3 a[5]=-16777215
motion a[0]=931123 a[1]=4946844 a[2]=0 a[3]=13 a[4]=2 a[5]=-16777215
motion a[0]=951323 a[1]=4950244 a[2]=0 a[3]=13 a[4]=2 a[5]=-16777215
motion a[0]=1011923 a[1]=4960446 a[2]=13 a[3]=11 a[4]=2 a[5]=-16777215
button press 1
motion a[0]=1014167 a[1]=4958746 a[2]=0 a[3]=11 a[4]=2 a[5]=-16777215
motion a[0]=1018336 a[1]=4956479 a[2]=0 a[3]=11 a[4]=2 a[5]=-16777215
motion a[0]=1039177 a[1]=4945143 a[2]=0 a[3]=10 a[4]=2 a[5]=-16777215
button release 1
motion a[0]=1041101 a[1]=4943443 a[2]=0 a[3]=10 a[4]=2 a[5]=-16777215
motion a[0]=1044628 a[1]=4941176 a[2]=0 a[3]=10 a[4]=3 a[5]=-16777215
motion a[0]=1049437 a[1]=4937775 a[2]=0 a[3]=10 a[4]=3 a[5]=-16777215
motion a[0]=1055529 a[1]=4932107 a[2]=0 a[3]=9 a[4]=3 a[5]=-16777215
motion a[0]=1059377 a[1]=4928140 a[2]=0 a[3]=8 a[4]=3 a[5]=-16777215
ID 26 outputs the following dragging the eraser over a short path on rnote; note it draws a line as above, vs erasing
...
motion a[0]=2398027 a[1]=2343062 a[2]=0 a[3]=13 a[4]=2
motion a[0]=2401875 a[1]=2356098 a[2]=0 a[3]=13 a[4]=2
motion a[0]=2414379 a[1]=2396906 a[2]=280 a[3]=11 a[4]=3
button press 1
motion a[0]=2416944 a[1]=2399740 a[2]=385 a[3]=11 a[4]=3
motion a[0]=2420792 a[1]=2403141 a[2]=477 a[3]=11 a[4]=3
...
motion a[0]=2454459 a[1]=2427512 a[2]=489 a[3]=10 a[4]=2
motion a[0]=2477865 a[1]=2436581 a[2]=0 a[3]=9 a[4]=3
button release 1
motion a[0]=2479468 a[1]=2436581 a[2]=0 a[3]=9 a[4]=3
motion a[0]=2482995 a[1]=2437148 a[2]=0 a[3]=9 a[4]=3
motion a[0]=2487805 a[1]=2437715 a[2]=0 a[3]=9 a[4]=4
...
in XPpen driver configuring the forward/pen-tip-side button to mouse right click, and in rnote setting Mouse secondary button action to erase --> works (holding the forward button and "drawing" does erase.
just noticed that with the same settings above (default erase function for rear eraser) the eraser works as expected in xournal++, so the signals/codes seem likely to be OK. Flip the pen around, it erases; flip back to point, no action needed the tip draws ink as expected.
Could you run
flatpak run --env=GTK_DEBUG=interactive com.github.flxzt.rnote
then navigate to the Global tab in the second window and copy the content using the clipboard icon in the topleft corner
And do something similar with xournalpp (either the same flatpak command but launching xournalpp or GTK_DEBUG=interactive xournalpp depending on the install) but this time go on the last tab, scroll to the bottom and screenshot what is in the Seat category.
I want to see if gtk sees something different for the pen between the two apps/gtk versions
Thank you for following up, and your work on rnote. Not having a functional eraser has really prevented me from using rnote for notes.
here's from xournal:
from rnote, slightly truncated, let me know if you're suspicious something is missing:
# flatpak run --env=GTK_DEBUG=interactive com.github.flxzt.rnote
<details open="true"><summary>General Information</summary>
| Name | Value |
| - | - |
| Operating System | GNOME 48 (Flatpak runtime) |
| GTK Version | 4.18.4 |
| GDK Backend | X11 |
| GSK Renderer | GL |
| Pango Fontmap | fontconfig |
| Media Backend | gstreamer |
| Input Method | ibus |
| Accessibility backend | atspi |
</details>
...
<details><summary>Seats</summary>
| Name | Value |
| - | - |
| Seat 0 | Pointer, Tablet, Keyboard |
| Logitech MX Master 3 | keyboard |
| Layouts | English (US)* |
| Power Button | keyboard |
| Layouts | English (US)* |
| XP-Pen Pen | keyboard |
| Layouts | English (US)* |
| Microsoft Microsoft® Nano Transceiver v2.1 System Control | keyboard |
| Layouts | English (US)* |
| UGTABLET Artist Pro 16 (Gen2) | keyboard |
| Layouts | English (US)* |
| Microsoft Microsoft® Nano Transceiver v2.1 Consumer Control | keyboard |
| Layouts | English (US)* |
| Power Button | keyboard |
| Layouts | English (US)* |
| XP-Pen Eraser | keyboard |
| Layouts | English (US)* |
| Microsoft Microsoft® Nano Transceiver v2.1 Consumer Control | keyboard |
| Layouts | English (US)* |
| Virtual core XTEST keyboard | keyboard |
| Layouts | English (US)* |
| XP-Pen Mouse | keyboard |
| Layouts | English (US)* |
| Microsoft Microsoft® Nano Transceiver v2.1 | keyboard |
| Layouts | English (US)* |
| UGTABLET Artist Pro 16 (Gen2) Keyboard | keyboard |
| Layouts | English (US)* |
| Logitech MX Master 3 | mouse |
| Microsoft Microsoft® Nano Transceiver v2.1 Mouse | mouse |
| Virtual core XTEST pointer | mouse |
| XP-Pen Mouse | pen |
| XP-Pen Pen Pen (0) | pen |
| Microsoft Microsoft® Nano Transceiver v2.1 Consumer Control | mouse |
| UGTABLET Artist Pro 16 (Gen2) Mouse | mouse |
| XP-Pen Eraser Eraser (0) | pen |
| Microsoft Microsoft® Nano Transceiver v2.1 Consumer Control | mouse |
...
I'm not very knowledgeable here, but i tried to look a bit more at the events generated. This supports I believe that both apps are getting the same events(??)
-
open rnote & xournal side by side on my xppen screen
-
run
sudo evtest$ sudo evtest No device specified, trying to scan all of /dev/input/event* Available devices: ... /dev/input/event7: UGTABLET Artist Pro 16 (Gen2) Mouse /dev/input/event8: UGTABLET Artist Pro 16 (Gen2) Keyboard /dev/input/event9: UGTABLET Artist Pro 16 (Gen2) /dev/input/event10: XP-Pen Pen ... /dev/input/event23: XP-Pen Mouse /dev/input/event24: XP-Pen Eraser Select the device event number [0-24]:
-
open all 6 (eg 6 terminals). use pen, eraser, and two buttons in both rnote & xournal. Note that only
event10andevent24receive any events.
as best I can tell, the exact same events are output from both. For the eraser that's as follows (full output attached as text file)
rnote:
Event: time 1749759725.876862, type 1 (EV_KEY), code 321 (BTN_TOOL_RUBBER), value 1
Event: time 1749759725.876862, type 3 (EV_ABS), code 0 (ABS_X), value 33739
Event: time 1749759725.876862, type 3 (EV_ABS), code 1 (ABS_Y), value 25561
Event: time 1749759725.876862, type 3 (EV_ABS), code 26 (ABS_TILT_X), value 5
Event: time 1749759725.876862, type 3 (EV_ABS), code 27 (ABS_TILT_Y), value -2
...
Event: time 1749759725.923832, -------------- SYN_REPORT ------------
Event: time 1749759725.927833, type 1 (EV_KEY), code 321 (BTN_TOOL_RUBBER), value 0
Event: time 1749759725.927833, type 3 (EV_ABS), code 26 (ABS_TILT_X), value 0
Event: time 1749759725.927833, type 3 (EV_ABS), code 27 (ABS_TILT_Y), value 0
Event: time 1749759725.927833, -------------- SYN_REPORT ------------
//end
xournal:
Event: time 1749759745.335158, type 1 (EV_KEY), code 321 (BTN_TOOL_RUBBER), value 1
Event: time 1749759745.335158, type 3 (EV_ABS), code 0 (ABS_X), value 47396
Event: time 1749759745.335158, type 3 (EV_ABS), code 1 (ABS_Y), value 25979
Event: time 1749759745.335158, type 3 (EV_ABS), code 26 (ABS_TILT_X), value 6
Event: time 1749759745.335158, type 3 (EV_ABS), code 27 (ABS_TILT_Y), value -2
...
Event: time 1749759745.387078, -------------- SYN_REPORT ------------
Event: time 1749759745.391073, type 1 (EV_KEY), code 321 (BTN_TOOL_RUBBER), value 0
Event: time 1749759745.391073, type 3 (EV_ABS), code 26 (ABS_TILT_X), value 0
Event: time 1749759745.391073, type 3 (EV_ABS), code 27 (ABS_TILT_Y), value 0
Event: time 1749759745.391073, -------------- SYN_REPORT ------------
//end
Well, the surprising part is here :
Xournalpp :
XP-Pen Eraser Eraser (0) : Eraser So when using the eraser, we'll see an eraser internally inside of rnote. So far so good
Rnote :
| XP-Pen Pen Pen (0) | pen | |
| XP-Pen Eraser Eraser (0) | pen | <-- the eraser is seen as a pen here so rnote sees a pen, not an eraser with the eraser |
So this is a gtk4 issue (why do they see a pen instead of an eraser, and also why that has changed from gtk3 that xournalpp is using)
is there a gtk4 test app to verify this? I found gtk3-demo which has a touch and drawing tablets widget. This app displays pen & eraser correctly.
I know nothing about gtk, or flatpak for that matter. I'm trying to build a similar gtk4 app, but am running into issues because (it appears) numerous things have changed w.r.t. stylus and what not between gtk4 4.6.9 (the stable version with ubuntu22.04), and gtk4 4.14 the latest stable (and I note that you appear to be using 4.14 Runtime: org.gnome.Platform/x86_64/48 from flatpak info com.github.flxzt.rnote. I gave up and tried an LLM, with some work I got the attached file. As far as I can tell it works (and confirms that I'm just getting mouse events, not pen or eraser)
I can't upgrade gtk4 ... if it's even possible it would way too risky. And for these hw/input related things, I don't see any point in trying to run an lxc or something. I am also not familiar with flatpak (at all), so I don't know how I"d proceed. I wonder if something like the attached could be built into a version of your app, or if it'd be trivial enough for someone experienced with flatpak to put this out, so that I can grab the debug output with latest gtk4?
is there a gtk4 test app to verify this? I found gtk3-demo which has a touch and drawing tablets widget. This app displays pen & eraser correctly.
Yes, open gtk4-demo and search for the Paint demo in the list to run.
The eraser works as an eraser, as long as gtk recognizes it at such correctly. The code is also attached in the source tab.
As far as I can tell it works (and confirms that I'm just getting mouse events, not pen or eraser)
And you can test with the demo whether it's a mouse or a pen from gtk4's side by activating stylus only
I'm trying to build a similar gtk4 app, but am running into issues because (it appears) numerous things have changed w.r.t. stylus and what not between gtk4 4.6.9 (the stable version with ubuntu22.04), and gtk4 4.14 the latest stable
In terms of what's working/not working? The API part for getting the device, pen/eraser and information hasn't really moved, I think.
and I note that you appear to be using 4.14 Runtime: org.gnome.Platform/x86_64/48 from flatpak info com.github.flxzt.rnote
What version of rnote are you on now ? 0.12 is on 4.18.5. If so that'd be a way to test things on recent gtk4 (update the flatpaks to check this)
And yes updating gtk4 itself can be risky (you won't find the latest version on 20.04 packages, if you don't compile from source. But flatpak is probably safer in that instance: instead of replacing gtk4 for potentially other package that depends on it, the flatpak version uses the org.gnome.Platform that can be updated independently from the apt one but also can never interact/mess up with the one in the package manager. If you're feeling adventurous you could also compile gtk from source trying not to mess with the apt version then launch gtk application using a LD_PRELOAD that'd point to the libgtk4.so of the new version.
For flatpak setup, I'm not sure of the procedure to test on a single C program (so you'd better off trying to find documentation on the flatpak website on how to setup that), what's used for rnote is the following manifest https://github.com/flxzt/rnote/blob/main/build-aux/com.github.flxzt.rnote.Devel.yaml
The "paint" test did not seem to do anything. A window opens in both gtk3 and gtk4 demos, and in both i can open and choose color, but in neither can i make marks, and neither displays anything about the input.
-------- Original Message -------- On 6/12/25 11:41 PM, Doublonmousse wrote:
Doublonmousse left a comment (flxzt/rnote#826)
is there a gtk4 test app to verify this? I found gtk3-demo which has a touch and drawing tablets widget. This app displays pen & eraser correctly.
Yes, open gtk4-demo and search for the Paint demo in the list to run.
The eraser works as an eraser, as long as gtk recognizes it at such correctly. The code is also attached in the source tab.
As far as I can tell it works (and confirms that I'm just getting mouse events, not pen or eraser)
And you can test with the demo whether it's a mouse or a pen from gtk4's side by activating stylus only
I'm trying to build a similar gtk4 app, but am running into issues because (it appears) numerous things have changed w.r.t. stylus and what not between gtk4 4.6.9 (the stable version with ubuntu22.04), and gtk4 4.14 the latest stable
In terms of what's working/not working? The API part for getting the device, pen/eraser and information hasn't really moved, I think.
and I note that you appear to be using 4.14 Runtime: org.gnome.Platform/x86_64/48 from flatpak info com.github.flxzt.rnote
What version of rnote are you on now ? 0.12 is on 4.18.5. If so that'd be a way to test things on recent gtk4 (update the flatpaks to check this)
And yes updating gtk4 itself can be risky (you won't find the latest version on 20.04 packages, if you don't compile from source. But flatpak is probably safer in that instance: instead of replacing gtk4 for potentially other package that depends on it, the flatpak version uses the org.gnome.Platform that can be updated independently from the apt one but also can never interact/mess up with the one in the package manager. If you're feeling adventurous you could also compile gtk from source trying not to mess with the apt version then launch gtk application using a LD_PRELOAD that'd point to the libgtk4.so of the new version.
For flatpak setup, I'm not sure of the procedure to test on a single C program (so you'd better off trying to find documentation on the flatpak website on how to setup that), what's used for rnote is the following manifest https://github.com/flxzt/rnote/blob/main/build-aux/com.github.flxzt.rnote.Devel.yaml
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>