Gnome input devices manager
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

69 lines
1.5 KiB

#include "htx.h"
static int htx_send_command(libusb_device_handle* hand, uint8_t command, uint8_t size, void* report)
{
htx_report_header_t* head = report;
head->report_size = size;
head->command = command;
// Send command
int res = libusb_control_transfer(hand,
0x21, // request type
0x09, // request (SET_REPORT)
0x300, // wValue (FEATURE << 8 | REPORT(0))
0x2, // wIndex = 0x2 : interface
report,
64, // wLength = 64
0 /* timeout*/);
if(res <= 0) return res;
// Get response report
res = libusb_control_transfer(hand,
0xa1, // request type
0x01, // request (GET_REPORT)
0x300, // wValue (FEATURE << 8 | REPORT(0))
0x2, // wIndex = 0x2 : interface
report,
64, // wLength = 64
0);
return res;
}
void driver_init(void) {}
uint32_t driver_getkey(void)
{
static int count = 0;
count++;
if(count == 1)
return (DEVICE_VENDOR_ID << 16) | DEVICE_PRODUCT_ID_WIRED;
else if(count == 2)
return (DEVICE_VENDOR_ID << 16) | DEVICE_PRODUCT_ID_WIRELESS;
return 0;
}
char* driver_get_name(void* handle)
{
libusb_device* dev = handle;
struct libusb_device_descriptor desc;
libusb_get_device_descriptor(dev, &desc);
switch(desc.idProduct)
{
case 0x5708:
case 0x5707:
return "HTX 4K";
default:
return "HTX ACE";
}
}
char* driver_get_image(void* handle)
{
return "drivers/g-wolves/htx/htx_0.png";
}