Skip to content

feat: add stylus barrel button action bindings#234

Merged
devmobasa merged 2 commits into
devmobasa:mainfrom
hakan-demirli:feature/stylus-barrel-button-bindings
May 30, 2026
Merged

feat: add stylus barrel button action bindings#234
devmobasa merged 2 commits into
devmobasa:mainfrom
hakan-demirli:feature/stylus-barrel-button-bindings

Conversation

@hakan-demirli
Copy link
Copy Markdown
Contributor

Summary

  • Add configurable action bindings for stylus barrel buttons (BTN_STYLUS / 331 and BTN_STYLUS2 / 332)
  • Handle zwp_tablet_tool_v2::Event::Button events and dispatch the configured action on press
  • Default: primary barrel button (331) opens the radial menu; secondary (332) is unbound
  • Existing proximity-based eraser auto-switch is unaffected

Details

Adds a StylusButtonBinding config type with a single action field that maps to any keybinding action. The binding is looked up and dispatched directly on button press without interacting with tool_override or the eraser auto-switch path.

Barrel buttons that trigger physical tool-type changes (pen/eraser cycling) continue to work through the existing auto_eraser_switch proximity handler.

Config

[tablet.stylus_button]
action = "toggle_radial_menu"

[tablet.stylus_button2]
# action = "undo"

hakan-demirli and others added 2 commits May 28, 2026 12:31
Queue stylus button presses until tablet frames commit so actions use the current stylus position, and route stylus-bound actions through the shared Wayland action follow-up path for persistence, zoom, clipboard, and tablet thickness side effects.

Document tablet button config, fix unbinding docs, and add coverage.
@devmobasa devmobasa merged commit 98d3d51 into devmobasa:main May 30, 2026
2 checks passed
@devmobasa
Copy link
Copy Markdown
Owner

Thanks @hakan-demirli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants