Get button mapping from libwacom
ClosedPublic

Authored by valeriymalov on Apr 9 2018, 8:05 PM.

Details

Summary

Grab evdev codes from libwacom and convert them into xsetwacom button
numbers
Requires libwacom 0.29
Add a crude "test" that compares local database data with libwacom data

This should make libwacom a suitable substitute for local database,
excluding status led info and button layout picture

BUG: 316837

Test Plan

Hard to test this without pad buttons so a code review would suffice

I've slapped together a crude "test tool" that compares data pulled from libwacom and data pulled from local installed database
Mostly it seems to match, ignoring the button order (I don't think we care about button order, since button order can be subjective when user is filling it out using tablet finder)
Where it doesn't match it probably needs to be checked individually via google or feedback from device owner
Here's the output for the test tool if anyone's curious: https://paste.kde.org/p1cfyhxrl

Diff Detail

Repository
R530 Wacom tablet support
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
valeriymalov requested review of this revision.Apr 9 2018, 8:05 PM
valeriymalov created this revision.
fvogt added inline comments.Apr 9 2018, 8:31 PM
src/common/libwacomwrapper.cpp
91

This gets called on every loop iteration - putting the return value in a variable would also allow to get rid of the function call in the preceding if.

95

I suggest to use parentheses here for grouping, it's not immediately obvious what this does.

(i < 4) ? i : (i + 4)

At this point it might also be useful to do this in a small utility function.

valeriymalov marked an inline comment as done.
  • Fixes

skipWheelButtons as separate function
remove multiple calls to libwacom_get_num_buttons

This revision was not accepted when it landed; it landed in state Needs Review.Apr 15 2018, 6:00 PM
This revision was automatically updated to reflect the committed changes.