Page MenuHome

GHOST/Wayland support for tablet events
AbandonedPublic

Authored by Campbell Barton (campbellbarton) on Jun 8 2022, 4:04 PM.

Details

Summary

Add support for tablet pressure, tilt and type detection (eraser, pen.. etc).

There is currently an inconsistency where the tablets cursor is scaled larger than the mouse cursor (when the UI is scaled).


Otherwise the basics are working, I'd like to be sure this isn't causing build issues on other peoples systems as I'm not sure how widely supported the tablet protocol is.

Diff Detail

Repository
rB Blender
Branch
TEMP-WAYLAND-MOTION (branched from master)
Build Status
Buildable 22473
Build 22473: arc lint + arc unit

Event Timeline

Campbell Barton (campbellbarton) requested review of this revision.Jun 8 2022, 4:04 PM
Campbell Barton (campbellbarton) created this revision.
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
  • Minor simplification for tablet_tool_data_ensure
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)

Move additional data about the tablets state (it's tool & cursor) into it's
"user-data", rather than using a map from it's ID.
This simplifies access and removes the need to account for the unlikely
case when the lookup fails.

Move the tablet data from the window into the tool,
this simplifies updating tablet data.

Is this tablet interface also supposed to work on touch screens (e.g. on laptops with touch screens or tablet devices without keyboards) or does this only work for "drawing tablets" that use a pen as input?

intern/ghost/intern/GHOST_SystemWayland.cpp
69–70

What are these magic values? Are they defined in some linux header?

  • Use define names from the linux-event-codes.h, add additional button.
Campbell Barton (campbellbarton) marked an inline comment as done.Jun 9 2022, 4:17 AM

Is this tablet interface also supposed to work on touch screens (e.g. on laptops with touch screens or tablet devices without keyboards) or does this only work for "drawing tablets" that use a pen as input?

From checking the docs, this is handled separately, touch has it's own section in https://wayland-book.com/seat.html

intern/ghost/intern/GHOST_SystemWayland.cpp
69–70

Found the values in input-event-codes.h, updated.

Campbell Barton (campbellbarton) marked an inline comment as done.
  • Remove comment, unnecessary forward declarations
  • Update comment on cursor scaling
  • Correct minor error in rebase

Fix last rebase (included some changes from master).

Committing this without review as I was mostly concerned using a newer tablet API might cause build issues.

As this isn't on by default and doesn't change library linking - this doesn't seem likely.

(I received an email with a comment "do you see any issues with this patch" that I cannot find here.)

The changes are fine. I don't have the hardware to test this. My only concern was about the "magic numbers". But I see that I also added those kinds of defines myself for the mouse buttons. I now remember that we did this because one of the Linux headers (I think linux/input-event-codes.h) was either not available or just did not contain those defines on CentOS 7.

To check build failures, I think it would be a good idea to add a "Wayland" build task on the build server to make sure that the Wayland implementation does not break over time.