Skip to content

Conversation

@gonX
Copy link
Member

@gonX gonX commented Aug 30, 2025

This adds a new type of bindings: Adaptive Bindings

Fixes #2510 for 0.6.x

Description

See the issue for what "adaptive means", but the gist of it is that tip binding means left click, and barrel buttons send the signal that equates to a right or middle click respectively. E.g. on Linux Artist Mode a right click is BTN_STYLUS2.

These new bindings are intended to be used when switching between output modes. These functionally replace the Linux Artist Mode bindings. No more juggling profiles for default use cases when switching between output modes 🎉

Additionally, daemon defaults now chooses these adaptive bindings as seen here:
Screenshot from 2025-08-30 at 03_01_27 946971502

Technical

A new interface IPenAction has been added to avoid reusing IMouseHandler as originally suggested in the issue we're solving. Without that change, mouse bindings could still be picked up. To keep compatibility with existing output modes implementing IMouseHandler, this PR also decides that the first tablet pen button correlates to right click, and the 2nd to middle click.

Please test thoroughly on non-Linux platforms. The 3 primary modes (artist, absolute, and relative) have been tested on Linux, but a double check is always handy.

Plugin developers making their own output modes may want to add support for these bindings (e.g. Windows Ink). The adaptive bindings supports output modes that implement either IPenActionHandler or MouseButtonHandler, and are injected via DI.

@gonX gonX added enhancement New feature or request desktop OpenTabletDriver.Desktop library, UX and Daemon use this as the core implementation. labels Aug 30, 2025
@gonX gonX marked this pull request as ready for review August 30, 2025 02:48
gonX added 8 commits August 30, 2025 13:55
This is to facilitate upcoming changes to adaptive bindings, which would
make this class able to handle mouse inputs, which it shouldn't
This is to facilitate an upcoming 'adaptive bindings' feature

Alternatively, we would have had to use `IMouseHandler` which would
cause some likely undesirable side effects
'field' is a new and preview-only keyword
@gonX gonX force-pushed the 06x-add-adaptive-bindings branch from cda8d24 to 647d000 Compare August 30, 2025 11:57
@gonX
Copy link
Member Author

gonX commented Aug 30, 2025

Rebased a comment out and force pushed. Also hopefully fixed the linting issue (and why doesn't Rider auto fix these for me??)

Code elsewhere in the project expects this to be present
@gonX gonX added this to the v0.6.6 milestone Sep 2, 2025
@Kuuuube
Copy link
Member

Kuuuube commented Sep 5, 2025

Looks like this is working perfectly on Linux. Still have Windows and MacOS to test.

@Kuuuube
Copy link
Member

Kuuuube commented Sep 5, 2025

Seems all good on Windows too. As mentioned, this does not work with Windows Ink plugin currently but there are no extra side effects. Exact same behavior as before this PR.

@Kuuuube
Copy link
Member

Kuuuube commented Sep 6, 2025

Confirmed working on MacOS by @TheSevenPens. No problems on all output modes and pen buttons.

@gonX gonX merged commit 706bd9e into OpenTabletDriver:0.6.x Sep 7, 2025
9 checks passed
@gonX gonX deleted the 06x-add-adaptive-bindings branch September 7, 2025 15:29
@gonX gonX added the needs-forward-port PR or its features needs to be ported to development branch label Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop OpenTabletDriver.Desktop library, UX and Daemon use this as the core implementation. enhancement New feature or request needs-forward-port PR or its features needs to be ported to development branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants