Restore BTN_MODE functionality to open steam menu
This commit is contained in:
parent
15fdb5a8be
commit
af411c4ba8
6 changed files with 458 additions and 252 deletions
Binary file not shown.
|
After Width: | Height: | Size: 116 KiB |
189
References/SteamDeck/descriptor.txt
Normal file
189
References/SteamDeck/descriptor.txt
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
Bus 001 Device 002: ID 28de:1205 Valve Software Steam Deck Controller
|
||||
Device Descriptor:
|
||||
bLength 18
|
||||
bDescriptorType 1
|
||||
bcdUSB 2.00
|
||||
bDeviceClass 0
|
||||
bDeviceSubClass 0
|
||||
bDeviceProtocol 0
|
||||
bMaxPacketSize0 64
|
||||
idVendor 0x28de Valve Software
|
||||
idProduct 0x1205
|
||||
bcdDevice 2.00
|
||||
iManufacturer 1 Valve Software
|
||||
iProduct 2 Steam Deck Controller
|
||||
iSerial 3 MEDA22129718
|
||||
bNumConfigurations 1
|
||||
Configuration Descriptor:
|
||||
bLength 9
|
||||
bDescriptorType 2
|
||||
wTotalLength 0x0096
|
||||
bNumInterfaces 5
|
||||
bConfigurationValue 1
|
||||
iConfiguration 0
|
||||
bmAttributes 0x80
|
||||
(Bus Powered)
|
||||
MaxPower 500mA
|
||||
Interface Descriptor:
|
||||
bLength 9
|
||||
bDescriptorType 4
|
||||
bInterfaceNumber 0
|
||||
bAlternateSetting 0
|
||||
bNumEndpoints 1
|
||||
bInterfaceClass 3 Human Interface Device
|
||||
bInterfaceSubClass 1 Boot Interface Subclass
|
||||
bInterfaceProtocol 1 Keyboard
|
||||
iInterface 0
|
||||
HID Device Descriptor:
|
||||
bLength 9
|
||||
bDescriptorType 33
|
||||
bcdHID 1.11
|
||||
bCountryCode 33 US
|
||||
bNumDescriptors 1
|
||||
bDescriptorType 34 Report
|
||||
wDescriptorLength 39
|
||||
Report Descriptors:
|
||||
** UNAVAILABLE **
|
||||
Endpoint Descriptor:
|
||||
bLength 7
|
||||
bDescriptorType 5
|
||||
bEndpointAddress 0x82 EP 2 IN
|
||||
bmAttributes 3
|
||||
Transfer Type Interrupt
|
||||
Synch Type None
|
||||
Usage Type Data
|
||||
wMaxPacketSize 0x0008 1x 8 bytes
|
||||
bInterval 1
|
||||
Interface Descriptor:
|
||||
bLength 9
|
||||
bDescriptorType 4
|
||||
bInterfaceNumber 1
|
||||
bAlternateSetting 0
|
||||
bNumEndpoints 1
|
||||
bInterfaceClass 3 Human Interface Device
|
||||
bInterfaceSubClass 0
|
||||
bInterfaceProtocol 2 Mouse
|
||||
iInterface 0
|
||||
HID Device Descriptor:
|
||||
bLength 9
|
||||
bDescriptorType 33
|
||||
bcdHID 1.11
|
||||
bCountryCode 0 Not supported
|
||||
bNumDescriptors 1
|
||||
bDescriptorType 34 Report
|
||||
wDescriptorLength 65
|
||||
Report Descriptors:
|
||||
** UNAVAILABLE **
|
||||
Endpoint Descriptor:
|
||||
bLength 7
|
||||
bDescriptorType 5
|
||||
bEndpointAddress 0x81 EP 1 IN
|
||||
bmAttributes 3
|
||||
Transfer Type Interrupt
|
||||
Synch Type None
|
||||
Usage Type Data
|
||||
wMaxPacketSize 0x0008 1x 8 bytes
|
||||
bInterval 1
|
||||
Interface Descriptor:
|
||||
bLength 9
|
||||
bDescriptorType 4
|
||||
bInterfaceNumber 2
|
||||
bAlternateSetting 0
|
||||
bNumEndpoints 1
|
||||
bInterfaceClass 3 Human Interface Device
|
||||
bInterfaceSubClass 0
|
||||
bInterfaceProtocol 0
|
||||
iInterface 0
|
||||
HID Device Descriptor:
|
||||
bLength 9
|
||||
bDescriptorType 33
|
||||
bcdHID 1.11
|
||||
bCountryCode 0 Not supported
|
||||
bNumDescriptors 1
|
||||
bDescriptorType 34 Report
|
||||
wDescriptorLength 25
|
||||
Report Descriptors:
|
||||
** UNAVAILABLE **
|
||||
Endpoint Descriptor:
|
||||
bLength 7
|
||||
bDescriptorType 5
|
||||
bEndpointAddress 0x83 EP 3 IN
|
||||
bmAttributes 3
|
||||
Transfer Type Interrupt
|
||||
Synch Type None
|
||||
Usage Type Data
|
||||
wMaxPacketSize 0x0040 1x 64 bytes
|
||||
bInterval 1
|
||||
Interface Association:
|
||||
bLength 8
|
||||
bDescriptorType 11
|
||||
bFirstInterface 3
|
||||
bInterfaceCount 2
|
||||
bFunctionClass 2 Communications
|
||||
bFunctionSubClass 2 Abstract (modem)
|
||||
bFunctionProtocol 1 AT-commands (v.25ter)
|
||||
iFunction 0
|
||||
Interface Descriptor:
|
||||
bLength 9
|
||||
bDescriptorType 4
|
||||
bInterfaceNumber 3
|
||||
bAlternateSetting 0
|
||||
bNumEndpoints 1
|
||||
bInterfaceClass 2 Communications
|
||||
bInterfaceSubClass 2 Abstract (modem)
|
||||
bInterfaceProtocol 1 AT-commands (v.25ter)
|
||||
iInterface 0
|
||||
CDC Header:
|
||||
bcdCDC 1.10
|
||||
CDC Call Management:
|
||||
bmCapabilities 0x01
|
||||
call management
|
||||
bDataInterface 2
|
||||
CDC ACM:
|
||||
bmCapabilities 0x02
|
||||
line coding and serial state
|
||||
CDC Union:
|
||||
bMasterInterface 3
|
||||
bSlaveInterface 4
|
||||
Endpoint Descriptor:
|
||||
bLength 7
|
||||
bDescriptorType 5
|
||||
bEndpointAddress 0x84 EP 4 IN
|
||||
bmAttributes 3
|
||||
Transfer Type Interrupt
|
||||
Synch Type None
|
||||
Usage Type Data
|
||||
wMaxPacketSize 0x0040 1x 64 bytes
|
||||
bInterval 255
|
||||
Interface Descriptor:
|
||||
bLength 9
|
||||
bDescriptorType 4
|
||||
bInterfaceNumber 4
|
||||
bAlternateSetting 0
|
||||
bNumEndpoints 2
|
||||
bInterfaceClass 10 CDC Data
|
||||
bInterfaceSubClass 0
|
||||
bInterfaceProtocol 0
|
||||
iInterface 0
|
||||
Endpoint Descriptor:
|
||||
bLength 7
|
||||
bDescriptorType 5
|
||||
bEndpointAddress 0x85 EP 5 IN
|
||||
bmAttributes 2
|
||||
Transfer Type Bulk
|
||||
Synch Type None
|
||||
Usage Type Data
|
||||
wMaxPacketSize 0x0040 1x 64 bytes
|
||||
bInterval 0
|
||||
Endpoint Descriptor:
|
||||
bLength 7
|
||||
bDescriptorType 5
|
||||
bEndpointAddress 0x05 EP 5 OUT
|
||||
bmAttributes 2
|
||||
Transfer Type Bulk
|
||||
Synch Type None
|
||||
Usage Type Data
|
||||
wMaxPacketSize 0x0040 1x 64 bytes
|
||||
bInterval 0
|
||||
Device Status: 0x0000
|
||||
(Bus Powered)
|
||||
13
logic.c
13
logic.c
|
|
@ -20,7 +20,8 @@ int logic_create(logic_t *const logic) {
|
|||
logic->gamepad.center = 0;
|
||||
memset(logic->gamepad.gyro, 0, sizeof(logic->gamepad.gyro));
|
||||
memset(logic->gamepad.accel, 0, sizeof(logic->gamepad.accel));
|
||||
|
||||
logic->gamepad.flags = 0;
|
||||
|
||||
const int mutex_creation_res = pthread_mutex_init(&logic->gamepad_mutex, NULL);
|
||||
if (mutex_creation_res != 0) {
|
||||
fprintf(stderr, "Unable to create mutex: %d\n", mutex_creation_res);
|
||||
|
|
@ -64,6 +65,16 @@ int logic_copy_gamepad_status(logic_t *const logic, gamepad_status_t *const out)
|
|||
}
|
||||
|
||||
*out = logic->gamepad;
|
||||
|
||||
if (logic->gamepad.flags & GAMEPAD_STATUS_FLAGS_PRESS_AND_REALEASE_CENTER) {
|
||||
if (out->center) {
|
||||
out->center = 0;
|
||||
logic->gamepad.flags &= ~GAMEPAD_STATUS_FLAGS_PRESS_AND_REALEASE_CENTER;
|
||||
} else {
|
||||
out->center = 1;
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&logic->gamepad_mutex);
|
||||
|
||||
logic_copy_gamepad_status_err:
|
||||
|
|
|
|||
4
logic.h
4
logic.h
|
|
@ -3,6 +3,8 @@
|
|||
#include "platform.h"
|
||||
#include "queue.h"
|
||||
|
||||
#define GAMEPAD_STATUS_FLAGS_PRESS_AND_REALEASE_CENTER 0x00000001U
|
||||
|
||||
typedef struct gamepad_status {
|
||||
|
||||
int32_t joystick_positions[2][2]; // [0 left | 1 right][x axis | y axis]
|
||||
|
|
@ -35,6 +37,8 @@ typedef struct gamepad_status {
|
|||
int16_t raw_gyro[3];
|
||||
int16_t raw_accel[3];
|
||||
|
||||
uint32_t flags;
|
||||
|
||||
} gamepad_status_t;
|
||||
|
||||
#define LOGIC_FLAGS_VIRT_DS4_ENABLE 0x00000001U
|
||||
|
|
|
|||
|
|
@ -681,6 +681,8 @@ static void update_gs_from_ev(gamepad_status_t *const gs, message_t *const msg)
|
|||
gs->r3 = msg->data.event.ev[i].value;
|
||||
} else if (msg->data.event.ev[i].code == BTN_THUMBL) {
|
||||
gs->l3 = msg->data.event.ev[i].value;
|
||||
} else if (msg->data.event.ev[i].code == BTN_MODE) {
|
||||
gs->flags |= GAMEPAD_STATUS_FLAGS_PRESS_AND_REALEASE_CENTER;
|
||||
}
|
||||
} else if (msg->data.event.ev[i].type == EV_ABS) {
|
||||
if (msg->data.event.ev[i].code == ABS_X) {
|
||||
|
|
|
|||
502
virt_ds4.c
502
virt_ds4.c
|
|
@ -29,257 +29,257 @@ static const uint16_t acc_z_minus = 0xe086;
|
|||
static const char* path = "/dev/uhid";
|
||||
|
||||
static unsigned char rdesc[] = {
|
||||
0x05, 0x01, /* Usage Page (Desktop), */
|
||||
0x09, 0x05, /* Usage (Gamepad), */
|
||||
0xA1, 0x01, /* Collection (Application), */
|
||||
0x85, 0x01, /* Report ID (1), */
|
||||
0x09, 0x30, /* Usage (X), */
|
||||
0x09, 0x31, /* Usage (Y), */
|
||||
0x09, 0x32, /* Usage (Z), */
|
||||
0x09, 0x35, /* Usage (Rz), */
|
||||
0x15, 0x00, /* Logical Minimum (0), */
|
||||
0x26, 0xFF, 0x00, /* Logical Maximum (255), */
|
||||
0x75, 0x08, /* Report Size (8), */
|
||||
0x95, 0x04, /* Report Count (4), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x09, 0x39, /* Usage (Hat Switch), */
|
||||
0x15, 0x00, /* Logical Minimum (0), */
|
||||
0x25, 0x07, /* Logical Maximum (7), */
|
||||
0x35, 0x00, /* Physical Minimum (0), */
|
||||
0x46, 0x3B, 0x01, /* Physical Maximum (315), */
|
||||
0x65, 0x14, /* Unit (Degrees), */
|
||||
0x75, 0x04, /* Report Size (4), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0x81, 0x42, /* Input (Variable, Null State), */
|
||||
0x65, 0x00, /* Unit, */
|
||||
0x05, 0x09, /* Usage Page (Button), */
|
||||
0x19, 0x01, /* Usage Minimum (01h), */
|
||||
0x29, 0x0E, /* Usage Maximum (0Eh), */
|
||||
0x15, 0x00, /* Logical Minimum (0), */
|
||||
0x25, 0x01, /* Logical Maximum (1), */
|
||||
0x75, 0x01, /* Report Size (1), */
|
||||
0x95, 0x0E, /* Report Count (14), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
|
||||
0x09, 0x20, /* Usage (20h), */
|
||||
0x75, 0x06, /* Report Size (6), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0x15, 0x00, /* Logical Minimum (0), */
|
||||
0x25, 0x3F, /* Logical Maximum (63), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x05, 0x01, /* Usage Page (Desktop), */
|
||||
0x09, 0x33, /* Usage (Rx), */
|
||||
0x09, 0x34, /* Usage (Ry), */
|
||||
0x15, 0x00, /* Logical Minimum (0), */
|
||||
0x26, 0xFF, 0x00, /* Logical Maximum (255), */
|
||||
0x75, 0x08, /* Report Size (8), */
|
||||
0x95, 0x02, /* Report Count (2), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
|
||||
0x09, 0x21, /* Usage (21h), */
|
||||
0x95, 0x03, /* Report Count (3), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x05, 0x01, /* Usage Page (Desktop), */
|
||||
0x19, 0x40, /* Usage Minimum (40h), */
|
||||
0x29, 0x42, /* Usage Maximum (42h), */
|
||||
0x16, 0x00, 0x80, /* Logical Minimum (-32768), */
|
||||
0x26, 0x00, 0x7F, /* Logical Maximum (32767), */
|
||||
0x75, 0x10, /* Report Size (16), */
|
||||
0x95, 0x03, /* Report Count (3), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x19, 0x43, /* Usage Minimum (43h), */
|
||||
0x29, 0x45, /* Usage Maximum (45h), */
|
||||
0x16, 0x00, 0xE0, /* Logical Minimum (-8192), */
|
||||
0x26, 0xFF, 0x1F, /* Logical Maximum (8191), */
|
||||
0x95, 0x03, /* Report Count (3), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
|
||||
0x09, 0x21, /* Usage (21h), */
|
||||
0x15, 0x00, /* Logical Minimum (0), */
|
||||
0x26, 0xFF, 0x00, /* Logical Maximum (255), */
|
||||
0x75, 0x08, /* Report Size (8), */
|
||||
0x95, 0x27, /* Report Count (39), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x85, 0x05, /* Report ID (5), */
|
||||
0x09, 0x22, /* Usage (22h), */
|
||||
0x95, 0x1F, /* Report Count (31), */
|
||||
0x91, 0x02, /* Output (Variable), */
|
||||
0x85, 0x04, /* Report ID (4), */
|
||||
0x09, 0x23, /* Usage (23h), */
|
||||
0x95, 0x24, /* Report Count (36), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x02, /* Report ID (2), */
|
||||
0x09, 0x24, /* Usage (24h), */
|
||||
0x95, 0x24, /* Report Count (36), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x08, /* Report ID (8), */
|
||||
0x09, 0x25, /* Usage (25h), */
|
||||
0x95, 0x03, /* Report Count (3), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x10, /* Report ID (16), */
|
||||
0x09, 0x26, /* Usage (26h), */
|
||||
0x95, 0x04, /* Report Count (4), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x11, /* Report ID (17), */
|
||||
0x09, 0x27, /* Usage (27h), */
|
||||
0x95, 0x02, /* Report Count (2), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x12, /* Report ID (18), */
|
||||
0x06, 0x02, 0xFF, /* Usage Page (FF02h), */
|
||||
0x09, 0x21, /* Usage (21h), */
|
||||
0x95, 0x0F, /* Report Count (15), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x13, /* Report ID (19), */
|
||||
0x09, 0x22, /* Usage (22h), */
|
||||
0x95, 0x16, /* Report Count (22), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x14, /* Report ID (20), */
|
||||
0x06, 0x05, 0xFF, /* Usage Page (FF05h), */
|
||||
0x09, 0x20, /* Usage (20h), */
|
||||
0x95, 0x10, /* Report Count (16), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x15, /* Report ID (21), */
|
||||
0x09, 0x21, /* Usage (21h), */
|
||||
0x95, 0x2C, /* Report Count (44), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x06, 0x80, 0xFF, /* Usage Page (FF80h), */
|
||||
0x85, 0x80, /* Report ID (128), */
|
||||
0x09, 0x20, /* Usage (20h), */
|
||||
0x95, 0x06, /* Report Count (6), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x81, /* Report ID (129), */
|
||||
0x09, 0x21, /* Usage (21h), */
|
||||
0x95, 0x06, /* Report Count (6), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x82, /* Report ID (130), */
|
||||
0x09, 0x22, /* Usage (22h), */
|
||||
0x95, 0x05, /* Report Count (5), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x83, /* Report ID (131), */
|
||||
0x09, 0x23, /* Usage (23h), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x84, /* Report ID (132), */
|
||||
0x09, 0x24, /* Usage (24h), */
|
||||
0x95, 0x04, /* Report Count (4), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x85, /* Report ID (133), */
|
||||
0x09, 0x25, /* Usage (25h), */
|
||||
0x95, 0x06, /* Report Count (6), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x86, /* Report ID (134), */
|
||||
0x09, 0x26, /* Usage (26h), */
|
||||
0x95, 0x06, /* Report Count (6), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x87, /* Report ID (135), */
|
||||
0x09, 0x27, /* Usage (27h), */
|
||||
0x95, 0x23, /* Report Count (35), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x88, /* Report ID (136), */
|
||||
0x09, 0x28, /* Usage (28h), */
|
||||
0x95, 0x22, /* Report Count (34), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x89, /* Report ID (137), */
|
||||
0x09, 0x29, /* Usage (29h), */
|
||||
0x95, 0x02, /* Report Count (2), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x90, /* Report ID (144), */
|
||||
0x09, 0x30, /* Usage (30h), */
|
||||
0x95, 0x05, /* Report Count (5), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x91, /* Report ID (145), */
|
||||
0x09, 0x31, /* Usage (31h), */
|
||||
0x95, 0x03, /* Report Count (3), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x92, /* Report ID (146), */
|
||||
0x09, 0x32, /* Usage (32h), */
|
||||
0x95, 0x03, /* Report Count (3), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x93, /* Report ID (147), */
|
||||
0x09, 0x33, /* Usage (33h), */
|
||||
0x95, 0x0C, /* Report Count (12), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA0, /* Report ID (160), */
|
||||
0x09, 0x40, /* Usage (40h), */
|
||||
0x95, 0x06, /* Report Count (6), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA1, /* Report ID (161), */
|
||||
0x09, 0x41, /* Usage (41h), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA2, /* Report ID (162), */
|
||||
0x09, 0x42, /* Usage (42h), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA3, /* Report ID (163), */
|
||||
0x09, 0x43, /* Usage (43h), */
|
||||
0x95, 0x30, /* Report Count (48), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA4, /* Report ID (164), */
|
||||
0x09, 0x44, /* Usage (44h), */
|
||||
0x95, 0x0D, /* Report Count (13), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA5, /* Report ID (165), */
|
||||
0x09, 0x45, /* Usage (45h), */
|
||||
0x95, 0x15, /* Report Count (21), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA6, /* Report ID (166), */
|
||||
0x09, 0x46, /* Usage (46h), */
|
||||
0x95, 0x15, /* Report Count (21), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xF0, /* Report ID (240), */
|
||||
0x09, 0x47, /* Usage (47h), */
|
||||
0x95, 0x3F, /* Report Count (63), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xF1, /* Report ID (241), */
|
||||
0x09, 0x48, /* Usage (48h), */
|
||||
0x95, 0x3F, /* Report Count (63), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xF2, /* Report ID (242), */
|
||||
0x09, 0x49, /* Usage (49h), */
|
||||
0x95, 0x0F, /* Report Count (15), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA7, /* Report ID (167), */
|
||||
0x09, 0x4A, /* Usage (4Ah), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA8, /* Report ID (168), */
|
||||
0x09, 0x4B, /* Usage (4Bh), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA9, /* Report ID (169), */
|
||||
0x09, 0x4C, /* Usage (4Ch), */
|
||||
0x95, 0x08, /* Report Count (8), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xAA, /* Report ID (170), */
|
||||
0x09, 0x4E, /* Usage (4Eh), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xAB, /* Report ID (171), */
|
||||
0x09, 0x4F, /* Usage (4Fh), */
|
||||
0x95, 0x39, /* Report Count (57), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xAC, /* Report ID (172), */
|
||||
0x09, 0x50, /* Usage (50h), */
|
||||
0x95, 0x39, /* Report Count (57), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xAD, /* Report ID (173), */
|
||||
0x09, 0x51, /* Usage (51h), */
|
||||
0x95, 0x0B, /* Report Count (11), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xAE, /* Report ID (174), */
|
||||
0x09, 0x52, /* Usage (52h), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xAF, /* Report ID (175), */
|
||||
0x09, 0x53, /* Usage (53h), */
|
||||
0x95, 0x02, /* Report Count (2), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xB0, /* Report ID (176), */
|
||||
0x09, 0x54, /* Usage (54h), */
|
||||
0x95, 0x3F, /* Report Count (63), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0xC0 /* End Collection */
|
||||
0x05, 0x01, /* Usage Page (Desktop), */
|
||||
0x09, 0x05, /* Usage (Gamepad), */
|
||||
0xA1, 0x01, /* Collection (Application), */
|
||||
0x85, 0x01, /* Report ID (1), */
|
||||
0x09, 0x30, /* Usage (X), */
|
||||
0x09, 0x31, /* Usage (Y), */
|
||||
0x09, 0x32, /* Usage (Z), */
|
||||
0x09, 0x35, /* Usage (Rz), */
|
||||
0x15, 0x00, /* Logical Minimum (0), */
|
||||
0x26, 0xFF, 0x00, /* Logical Maximum (255), */
|
||||
0x75, 0x08, /* Report Size (8), */
|
||||
0x95, 0x04, /* Report Count (4), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x09, 0x39, /* Usage (Hat Switch), */
|
||||
0x15, 0x00, /* Logical Minimum (0), */
|
||||
0x25, 0x07, /* Logical Maximum (7), */
|
||||
0x35, 0x00, /* Physical Minimum (0), */
|
||||
0x46, 0x3B, 0x01, /* Physical Maximum (315), */
|
||||
0x65, 0x14, /* Unit (Degrees), */
|
||||
0x75, 0x04, /* Report Size (4), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0x81, 0x42, /* Input (Variable, Null State), */
|
||||
0x65, 0x00, /* Unit, */
|
||||
0x05, 0x09, /* Usage Page (Button), */
|
||||
0x19, 0x01, /* Usage Minimum (01h), */
|
||||
0x29, 0x0E, /* Usage Maximum (0Eh), */
|
||||
0x15, 0x00, /* Logical Minimum (0), */
|
||||
0x25, 0x01, /* Logical Maximum (1), */
|
||||
0x75, 0x01, /* Report Size (1), */
|
||||
0x95, 0x0E, /* Report Count (14), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
|
||||
0x09, 0x20, /* Usage (20h), */
|
||||
0x75, 0x06, /* Report Size (6), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0x15, 0x00, /* Logical Minimum (0), */
|
||||
0x25, 0x3F, /* Logical Maximum (63), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x05, 0x01, /* Usage Page (Desktop), */
|
||||
0x09, 0x33, /* Usage (Rx), */
|
||||
0x09, 0x34, /* Usage (Ry), */
|
||||
0x15, 0x00, /* Logical Minimum (0), */
|
||||
0x26, 0xFF, 0x00, /* Logical Maximum (255), */
|
||||
0x75, 0x08, /* Report Size (8), */
|
||||
0x95, 0x02, /* Report Count (2), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
|
||||
0x09, 0x21, /* Usage (21h), */
|
||||
0x95, 0x03, /* Report Count (3), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x05, 0x01, /* Usage Page (Desktop), */
|
||||
0x19, 0x40, /* Usage Minimum (40h), */
|
||||
0x29, 0x42, /* Usage Maximum (42h), */
|
||||
0x16, 0x00, 0x80, /* Logical Minimum (-32768), */
|
||||
0x26, 0x00, 0x7F, /* Logical Maximum (32767), */
|
||||
0x75, 0x10, /* Report Size (16), */
|
||||
0x95, 0x03, /* Report Count (3), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x19, 0x43, /* Usage Minimum (43h), */
|
||||
0x29, 0x45, /* Usage Maximum (45h), */
|
||||
0x16, 0x00, 0xE0, /* Logical Minimum (-8192), */
|
||||
0x26, 0xFF, 0x1F, /* Logical Maximum (8191), */
|
||||
0x95, 0x03, /* Report Count (3), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
|
||||
0x09, 0x21, /* Usage (21h), */
|
||||
0x15, 0x00, /* Logical Minimum (0), */
|
||||
0x26, 0xFF, 0x00, /* Logical Maximum (255), */
|
||||
0x75, 0x08, /* Report Size (8), */
|
||||
0x95, 0x27, /* Report Count (39), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x85, 0x05, /* Report ID (5), */
|
||||
0x09, 0x22, /* Usage (22h), */
|
||||
0x95, 0x1F, /* Report Count (31), */
|
||||
0x91, 0x02, /* Output (Variable), */
|
||||
0x85, 0x04, /* Report ID (4), */
|
||||
0x09, 0x23, /* Usage (23h), */
|
||||
0x95, 0x24, /* Report Count (36), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x02, /* Report ID (2), */
|
||||
0x09, 0x24, /* Usage (24h), */
|
||||
0x95, 0x24, /* Report Count (36), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x08, /* Report ID (8), */
|
||||
0x09, 0x25, /* Usage (25h), */
|
||||
0x95, 0x03, /* Report Count (3), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x10, /* Report ID (16), */
|
||||
0x09, 0x26, /* Usage (26h), */
|
||||
0x95, 0x04, /* Report Count (4), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x11, /* Report ID (17), */
|
||||
0x09, 0x27, /* Usage (27h), */
|
||||
0x95, 0x02, /* Report Count (2), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x12, /* Report ID (18), */
|
||||
0x06, 0x02, 0xFF, /* Usage Page (FF02h), */
|
||||
0x09, 0x21, /* Usage (21h), */
|
||||
0x95, 0x0F, /* Report Count (15), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x13, /* Report ID (19), */
|
||||
0x09, 0x22, /* Usage (22h), */
|
||||
0x95, 0x16, /* Report Count (22), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x14, /* Report ID (20), */
|
||||
0x06, 0x05, 0xFF, /* Usage Page (FF05h), */
|
||||
0x09, 0x20, /* Usage (20h), */
|
||||
0x95, 0x10, /* Report Count (16), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x15, /* Report ID (21), */
|
||||
0x09, 0x21, /* Usage (21h), */
|
||||
0x95, 0x2C, /* Report Count (44), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x06, 0x80, 0xFF, /* Usage Page (FF80h), */
|
||||
0x85, 0x80, /* Report ID (128), */
|
||||
0x09, 0x20, /* Usage (20h), */
|
||||
0x95, 0x06, /* Report Count (6), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x81, /* Report ID (129), */
|
||||
0x09, 0x21, /* Usage (21h), */
|
||||
0x95, 0x06, /* Report Count (6), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x82, /* Report ID (130), */
|
||||
0x09, 0x22, /* Usage (22h), */
|
||||
0x95, 0x05, /* Report Count (5), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x83, /* Report ID (131), */
|
||||
0x09, 0x23, /* Usage (23h), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x84, /* Report ID (132), */
|
||||
0x09, 0x24, /* Usage (24h), */
|
||||
0x95, 0x04, /* Report Count (4), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x85, /* Report ID (133), */
|
||||
0x09, 0x25, /* Usage (25h), */
|
||||
0x95, 0x06, /* Report Count (6), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x86, /* Report ID (134), */
|
||||
0x09, 0x26, /* Usage (26h), */
|
||||
0x95, 0x06, /* Report Count (6), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x87, /* Report ID (135), */
|
||||
0x09, 0x27, /* Usage (27h), */
|
||||
0x95, 0x23, /* Report Count (35), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x88, /* Report ID (136), */
|
||||
0x09, 0x28, /* Usage (28h), */
|
||||
0x95, 0x22, /* Report Count (34), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x89, /* Report ID (137), */
|
||||
0x09, 0x29, /* Usage (29h), */
|
||||
0x95, 0x02, /* Report Count (2), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x90, /* Report ID (144), */
|
||||
0x09, 0x30, /* Usage (30h), */
|
||||
0x95, 0x05, /* Report Count (5), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x91, /* Report ID (145), */
|
||||
0x09, 0x31, /* Usage (31h), */
|
||||
0x95, 0x03, /* Report Count (3), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x92, /* Report ID (146), */
|
||||
0x09, 0x32, /* Usage (32h), */
|
||||
0x95, 0x03, /* Report Count (3), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0x93, /* Report ID (147), */
|
||||
0x09, 0x33, /* Usage (33h), */
|
||||
0x95, 0x0C, /* Report Count (12), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA0, /* Report ID (160), */
|
||||
0x09, 0x40, /* Usage (40h), */
|
||||
0x95, 0x06, /* Report Count (6), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA1, /* Report ID (161), */
|
||||
0x09, 0x41, /* Usage (41h), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA2, /* Report ID (162), */
|
||||
0x09, 0x42, /* Usage (42h), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA3, /* Report ID (163), */
|
||||
0x09, 0x43, /* Usage (43h), */
|
||||
0x95, 0x30, /* Report Count (48), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA4, /* Report ID (164), */
|
||||
0x09, 0x44, /* Usage (44h), */
|
||||
0x95, 0x0D, /* Report Count (13), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA5, /* Report ID (165), */
|
||||
0x09, 0x45, /* Usage (45h), */
|
||||
0x95, 0x15, /* Report Count (21), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA6, /* Report ID (166), */
|
||||
0x09, 0x46, /* Usage (46h), */
|
||||
0x95, 0x15, /* Report Count (21), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xF0, /* Report ID (240), */
|
||||
0x09, 0x47, /* Usage (47h), */
|
||||
0x95, 0x3F, /* Report Count (63), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xF1, /* Report ID (241), */
|
||||
0x09, 0x48, /* Usage (48h), */
|
||||
0x95, 0x3F, /* Report Count (63), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xF2, /* Report ID (242), */
|
||||
0x09, 0x49, /* Usage (49h), */
|
||||
0x95, 0x0F, /* Report Count (15), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA7, /* Report ID (167), */
|
||||
0x09, 0x4A, /* Usage (4Ah), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA8, /* Report ID (168), */
|
||||
0x09, 0x4B, /* Usage (4Bh), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xA9, /* Report ID (169), */
|
||||
0x09, 0x4C, /* Usage (4Ch), */
|
||||
0x95, 0x08, /* Report Count (8), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xAA, /* Report ID (170), */
|
||||
0x09, 0x4E, /* Usage (4Eh), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xAB, /* Report ID (171), */
|
||||
0x09, 0x4F, /* Usage (4Fh), */
|
||||
0x95, 0x39, /* Report Count (57), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xAC, /* Report ID (172), */
|
||||
0x09, 0x50, /* Usage (50h), */
|
||||
0x95, 0x39, /* Report Count (57), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xAD, /* Report ID (173), */
|
||||
0x09, 0x51, /* Usage (51h), */
|
||||
0x95, 0x0B, /* Report Count (11), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xAE, /* Report ID (174), */
|
||||
0x09, 0x52, /* Usage (52h), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xAF, /* Report ID (175), */
|
||||
0x09, 0x53, /* Usage (53h), */
|
||||
0x95, 0x02, /* Report Count (2), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x85, 0xB0, /* Report ID (176), */
|
||||
0x09, 0x54, /* Usage (54h), */
|
||||
0x95, 0x3F, /* Report Count (63), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0xC0 /* End Collection */
|
||||
};
|
||||
|
||||
static int uhid_write(int fd, const struct uhid_event *ev)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue