Skip to content

Input: add ABS_TWIST and support it in HID and Wacom

Siarhei Vishniakou linux-doc linux-input lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3Input: add ABS_TWIST event codeDocumentation/input/event-codes.rst drivers/hid/hid-debug.c include/uapi/linux/input-event-codes.h+8 -00 replies
2/3HID: input: map Digitizers Twist usage to ABS_TWISTdrivers/hid/hid-input-test.c drivers/hid/hid-input.c+92 -00 replies
3/3HID: wacom: report ABS_TWIST alongside ABS_Z for pen twistdrivers/hid/wacom_wac.c+29 -61 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] Input: add ABS_TWIST and support it in HID and Wacom

Some styli can report rotation along their long ("barrel") axis, commonly referred to as "twist". While the HID specification defines this usage as HID_DG_TWIST (0x000d0041) in the Digitizers page, there is currently no corresponding evdev axis code to expose it to userspace.

Because evdev has no MSC_SCAN equivalent for axes, drivers and OEMs currently work around this by mapping stylus twist onto unrelated axes such as ABS_Z or ABS_RZ. As a result, userspace input stacks must maintain device-specific workarounds to know which axis carries twist.

This series introduces a dedicated ABS_TWIST (0x1d) axis for single-tool devices such as styli and wires it up in the HID subsystem:

1. Input: Define ABS_TWIST (0x1d) in input-event-codes.h and document it in event-codes.rst with resolution in units/radian.
2. HID: Map HID_DG_TWIST (0x000d0041) to ABS_TWIST in hid-input, compute its resolution in units/radian, and add KUnit test coverage.
3. HID: wacom: Report pen twist on ABS_TWIST in addition to ABS_Z so that userspace can use the standard axis while maintaining backward compatibility with existing applications that expect ABS_Z.

Siarhei Vishniakou (3):
Input: add ABS_TWIST event code
HID: input: map Digitizers Twist usage to ABS_TWIST
HID: wacom: report ABS_TWIST alongside ABS_Z for pen twist

 Documentation/input/event-codes.rst    |  6 ++
 drivers/hid/hid-debug.c                |  1 +
 drivers/hid/hid-input-test.c           | 87 ++++++++++++++++++++++++++
 drivers/hid/hid-input.c                |  5 ++
 drivers/hid/wacom_wac.c                | 35 +++++++++--
 include/uapi/linux/input-event-codes.h |  1 +
 6 files changed, 129 insertions(+), 6 deletions(-)
Signature · 1 line
2.56.0.455.g6c5a503b38-goog