diff --git a/includes/include.h b/includes/include.h index 87b5304..08a408a 100644 --- a/includes/include.h +++ b/includes/include.h @@ -7,8 +7,12 @@ #include #include "libusb-1.0.30/libusb/libusb.h" -// mouse pid +// mouse pids #define TARGET_VID 0x3554 -#define TARGET_PID 0xf54d +#define TARGET_PID_WIRED 0xf54d +#define TARGET_PID_WIRELESS 0xf54f + +// mouse pid helper +#define IS_TARGET_PID(pid) ((pid) == TARGET_PID_WIRED || (pid) == TARGET_PID_WIRELESS) #endif diff --git a/src/driver.c b/src/driver.c index 73c6668..e2e5fe0 100644 --- a/src/driver.c +++ b/src/driver.c @@ -10,7 +10,12 @@ void run_driver(int sens) { return; } - handle = libusb_open_device_with_vid_pid(NULL, TARGET_VID, TARGET_PID); + // wired/wireless support + handle = libusb_open_device_with_vid_pid(NULL, TARGET_VID, TARGET_PID_WIRED); + if (!handle) { + handle = libusb_open_device_with_vid_pid(NULL, TARGET_VID, TARGET_PID_WIRELESS); + } + if (!handle) { fprintf(stderr, "mouse not found!!\n"); libusb_exit(NULL);