hid: dragonrise: map gamepad buttons to BTN_GAMEPAD?
From: Shehriyar Qureshi <hidden>
Date: 2026-08-02 09:00:39
Hi,
I have a Ucom ps2-style usb game controller.
I noticed that the controller exposes BTN_JOYSTICK events rather than
BTN_GAMEPAD. I first noticed this when using raylib/glfw, which treats
BTN_GAMEPAD events as standard gamepad buttons.
One possible solution would be in userspace. However, I was wondering
whether `dragonrise` should remap it to BTN_GAMEPAD codes or if the
existing joystick mapping is intentional.
I understand that mapping based on the HID descriptor to joystick
events is expected behaviour, but I was wondering if this device should
be treated differently because it is physically a gamepad.
Sharing details of hardware below.
Hardware:
=========
Controller: DragonRise Inc. PC TWIN SHOCK Gamepad
USB ID: 0079:0006
Kernel log:
===========
$ dmesg | grep -E "Microntek|dragonrise"
[ 2.268782] usb 1-3: Manufacturer: Microntek
[ 3.653949] input: Microntek USB Joystick as /devices/pci0000:00/0000:00:02.1/0000:02:00.0/0000:03:0c.0/0000:09:00.0/usb1/1-3/1-3:1.0/0003:0079:0006.0001/input/input7
[ 3.654013] dragonrise 0003:0079:0006.0001: input,hidraw4: USB HID v1.10 Joystick [Microntek USB Joystick ] on usb-0000:09:00.0-3/input0
[ 3.654018] dragonrise 0003:0079:0006.0001: Force Feedback for DragonRise Inc. game controllers by Richard Walmsley [off-list ref]
USB info:
=========
$ lsusb
Bus 001 Device 003: ID 0079:0006 DragonRise Inc. PC TWIN SHOCK Gamepad
$ lsusb -t
|__ Port 003: Dev 003, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
HID descriptor:
===============
when bound to the `dragonrise` driver.
$ hid-decode /sys/bus/hid/devices/0003:0079:0006.0001/report_descriptor
# device 0:0
# 0x05, 0x01, // Usage Page (Generic Desktop) 0
# 0x09, 0x04, // Usage (Joystick) 2
...
evtest reports:
===============
$ evtest
Input device ID: bus 0x3 vendor 0x79 product 0x6 version 0x110
Input device name: "Microntek USB Joystick "
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 288 (BTN_TRIGGER)
Event code 289 (BTN_THUMB)
Event code 290 (BTN_THUMB2)
Event code 291 (BTN_TOP)
Event code 292 (BTN_TOP2)
Event code 293 (BTN_PINKIE)
Event code 294 (BTN_BASE)
Event code 295 (BTN_BASE2)
Event code 296 (BTN_BASE3)
Event code 297 (BTN_BASE4)
Event code 298 (BTN_BASE5)
Event code 299 (BTN_BASE6)
...
for comparison, this is evtest report for the xbox style controller.
$ evtest
Input device ID: bus 0x3 vendor 0x45e product 0x28e version 0x110
Input device name: "Microsoft X-Box 360 pad"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 304 (BTN_SOUTH)
Event code 305 (BTN_EAST)
Event code 307 (BTN_NORTH)
Event code 308 (BTN_WEST)
Event code 310 (BTN_TL)
Event code 311 (BTN_TR)
Event code 314 (BTN_SELECT)
Event code 315 (BTN_START)
Event code 316 (BTN_MODE)
Event code 317 (BTN_THUMBL)
Event code 318 (BTN_THUMBR)
...