smithay icon indicating copy to clipboard operation
smithay copied to clipboard

feat: implement TabletPadButtonEvent support

Open coleleavitt opened this issue 2 months ago • 2 comments

This pull request adds support for tablet pad button events to the input backend system. It introduces a new trait for tablet pad button events, updates the input event enum to handle these events, and implements the necessary plumbing for the LibinputInputBackend to process tablet pad button events. Backends that do not support tablet pad buttons are updated to use the UnusedEvent type.

Tablet Pad Button Event Support

  • Added a new trait TabletPadButtonEvent with methods for button code and state in src/backend/input/tablet.rs, along with an implementation for the UnusedEvent type.
  • Extended the InputBackend trait to include an associated type for tablet pad button events.
  • Updated the InputEvent enum to include a new variant TabletPadButton for tablet pad button events.

Libinput Backend Integration

  • Implemented TabletPadButtonEvent for event::tablet_pad::TabletPadButtonEvent and integrated event handling for tablet pad button events in LibinputInputBackend. [1] [2] [3]

Backend Compatibility

  • Updated the WinitInput and X11Input backends to use UnusedEvent for the new tablet pad button event type to maintain compatibility. [1] [2]

Public API Update

  • Added TabletPadButtonEvent to the list of publicly re-exported tablet input types in src/backend/input/mod.rs.

The reason for this was due to: https://github.com/YaLTeR/niri/pull/2536

coleleavitt avatar Oct 06 '25 23:10 coleleavitt

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 16.98%. Comparing base (4ecc206) to head (38bce91). :warning: Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1836      +/-   ##
==========================================
- Coverage   19.10%   16.98%   -2.12%     
==========================================
  Files         177      177              
  Lines       27868    27871       +3     
==========================================
- Hits         5324     4734     -590     
- Misses      22544    23137     +593     
Flag Coverage Δ
wlcs-buffer 16.57% <ø> (-0.01%) :arrow_down:
wlcs-core ?
wlcs-output 6.79% <ø> (-0.01%) :arrow_down:
wlcs-pointer-input ?

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Oct 07 '25 10:10 codecov-commenter

Thanks for the contribution!

I'd apprechiate it, if you'd consider also wiring up Ring and Strip events at some point.

I'll see if I can get around to it tonight, thank you

coleleavitt avatar Oct 07 '25 17:10 coleleavitt