[PATCH wayland-protocols] tablet: specify the tool button numbers are simply sequentially numbered

Peter Hutterer peter.hutterer at who-t.net
Fri Nov 4 01:46:38 UTC 2016

We're using sequentially numbered buttons for the pad because actual tablets
are quite varied in how the present buttons (BTN_A, BTN_0, etc.). For this
reason, libinput numbers pad buttons sequentially.

Let's do the same for tablet tools. Unfortunately libinput doesn't do this, so
the mapping is up to the compositor but at least we can get the wayland
protocol right. The ony event codes a tool currently sends are BTN_STYLUS and
BTN_STYLUS2 anyway, so it's already sequentially numbered with a make-pretend
fancy name.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
This is something Carlos and I discussed at XDC, TLDR: it doesn't make much
sense sending BTN_STYLUS for a tool but button index 0 for the pad.

I didn't bump the version number here because it either
a) doesn't matter to clients
b) needs a interface version bump, but then probably a) applies
c) needs a full tablet-unstable-v3.xml but that seems excessive.

Not 100% which one of those applies, Carlos will know more since he's doing
the mutter/GTK bits. Weston doesn't care, we don't have a tablet
implementation yet.

 unstable/tablet/tablet-unstable-v2.xml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/unstable/tablet/tablet-unstable-v2.xml b/unstable/tablet/tablet-unstable-v2.xml
index 728a3df..e7a15bd 100644
--- a/unstable/tablet/tablet-unstable-v2.xml
+++ b/unstable/tablet/tablet-unstable-v2.xml
@@ -555,6 +555,8 @@
 	button events are generated by the compositor. See
 	wp_tablet_tool.proximity_in and wp_tablet_tool.proximity_out for
+	Buttons are indexed sequentially, starting at button 0.
       <arg name="serial" type="uint"/>
@@ -1141,6 +1143,8 @@
     <event name="button">
       <description summary="physical button state">
 	Sent whenever the physical state of a button changes.
+	Buttons are indexed sequentially, starting at button 0.
       <arg name="time" type="uint" summary="the time of the event with millisecond granularity"/>
       <arg name="button" type="uint" summary="the index of the button that changed state"/>

More information about the wayland-devel mailing list