USB HID parser shows wrong label for usages Rx/Vx/Vbrx of usage page Generic Desktop Control
Summary
For HID USB devices that use usages 0x33 (Rx), 0x40 (Vx), or 0x43 (Vbrx) the wrong labels (Rz, Vz, Vbrz) are shown.
I saw it for “Rx” only but found the same error in the code for the other two mentioned. (See below for links to the code.)
Sample capture file
-/-
Relevant parts of capture (HID Report Descriptor):
Frame 12: 89 bytes on wire (712 bits), 89 bytes captured (712 bits) on interface \\.\USBPcap1, id 0
USB URB
HID Report
Usage Page: Generic Desktop Controls (0x01)
Usage: Joystick (0x04)
Collection (Application)
Collection type: Application (0x01)
Usage (Pointer)
Collection (Physical)
Usage Minimum (0x30)
Usage Maximum (0x32)
Input (Data,Var,Abs)
End Collection
Usage (Pointer)
Collection (Physical)
Usage Minimum (0x33)
Usage Maximum (0x35)
Input (Data,Var,Abs)
End Collection
Usage Page (Button)
…
(Note the second Usage Minimum being 0x33)
Steps to reproduce
Connect a USB HID that uses the mentioned usages.
What is the current bug behavior?
Interrupt in:
Frame 15: 44 bytes on wire (352 bits), 44 bytes captured (352 bits) on interface \\.\USBPcap1, id 0
USB URB
HID Data: 23027d01df0220018202dc010bf4f40b23
0000 0010 0010 0011 = X Axis: 547
0000 0001 0111 1101 = Y Axis: 381
0000 0010 1101 1111 = Z Axis: 735
0000 0001 0010 0000 = Rz Axis: 288
0000 0010 1000 0010 = Ry Axis: 642
0000 0001 1101 1100 = Rz Axis: 476
.... ...1 = Button: 1 (primary/trigger): DOWN
.... ..1. = Button: 2 (secondary): DOWN
.... .0.. = Button: 3 (tertiary): UP
…
(Note the first “Rz Axis” which should read “Rx Axis”)
What is the expected correct behavior?
The label should read as “Rx Axis”.
Build information
Version 4.0.5 (v4.0.5-0-ge556162d8da3).
Compiled (64-bit) using Microsoft Visual Studio 2022 (VC++ 14.32, build 31332),
with GLib 2.72.3, with PCRE2, with zlib 1.2.12, with Qt 5.15.2, with libpcap,
with Lua 5.2.4, with GnuTLS 3.6.3 and PKCS #11 support, with Gcrypt 1.10.1, with
Kerberos (MIT), with MaxMind, with nghttp2 1.46.0, with brotli, with LZ4, with
Zstandard, with Snappy, with libxml2 2.9.14, with libsmi 0.4.8, with
QtMultimedia, with automatic updates using WinSparkle 0.5.7, with AirPcap, with
SpeexDSP (using bundled resampler), with Minizip, with binary plugins.
Running on 64-bit Windows 7 Service Pack 1, build 7601, with Intel(R) Core(TM)
i7-6500U CPU @ 2.50GHz (with SSE4.2), with 16287 MB of physical memory, with
GLib 2.72.3, with PCRE2 10.40 2022-04-14, with Qt 5.15.2, with Npcap version
1.71, based on libpcap version 1.10.2-PRE-GIT, with c-ares 1.18.1, with GnuTLS
3.6.3, with Gcrypt 1.10.1, with nghttp2 1.46.0, with brotli 1.0.9, with LZ4
1.9.3, with Zstandard 1.5.2, without AirPcap, with light display mode, without
HiDPI, with LC_TYPE=C, binary plugins supported.
Proposed Fix
The error can be found here for Rx, here for Vx, and here for Vbrx