From 58fb4da9a702bf24c80bb79626e9ce05bc411069 Mon Sep 17 00:00:00 2001 From: ccMSC Date: Thu, 30 Jun 2016 04:37:10 -0600 Subject: [PATCH] M65 Pro support --- src/ckb-daemon/usb.c | 2 +- src/ckb-daemon/usb.h | 6 ++++-- src/ckb-daemon/usb_linux.c | 1 + src/ckb-daemon/usb_mac.c | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ckb-daemon/usb.c b/src/ckb-daemon/usb.c index a1068823..dbb12178 100644 --- a/src/ckb-daemon/usb.c +++ b/src/ckb-daemon/usb.c @@ -32,7 +32,7 @@ const char* product_str(short product){ return "k65"; if(product == P_STRAFE || product == P_STRAFE_NRGB) return "strafe"; - if(product == P_M65) + if(product == P_M65 || product == P_M65_PRO) return "m65"; if(product == P_SABRE_O || product == P_SABRE_L || product == P_SABRE_N) return "sabre"; diff --git a/src/ckb-daemon/usb.h b/src/ckb-daemon/usb.h index 4e2aeb5f..42377a43 100644 --- a/src/ckb-daemon/usb.h +++ b/src/ckb-daemon/usb.h @@ -40,7 +40,9 @@ #define P_M65 0x1b12 #define P_M65_STR "1b12" -#define IS_M65(kb) ((kb)->vendor == V_CORSAIR && ((kb)->product == P_M65)) +#define P_M65_PRO 0x1b2e +#define P_M65_PRO_STR "1b2e" +#define IS_M65(kb) ((kb)->vendor == V_CORSAIR && ((kb)->product == P_M65 || (kb)->product == P_M65_PRO)) #define P_SABRE_O 0x1b14 /* optical */ #define P_SABRE_O_STR "1b14" @@ -74,7 +76,7 @@ const char* product_str(short product); #define IS_FULLRANGE(kb) (IS_RGB((kb)->vendor, (kb)->product) && (kb)->product != P_K65 && (kb)->product != P_K70 && (kb)->product != P_K95) // Mouse vs keyboard test -#define IS_MOUSE(vendor, product) ((vendor) == (V_CORSAIR) && ((product) == (P_M65) || (product) == (P_SABRE_O) || (product) == (P_SABRE_L) || (product) == (P_SABRE_N) || (product) == (P_SCIMITAR))) +#define IS_MOUSE(vendor, product) ((vendor) == (V_CORSAIR) && ((product) == (P_M65) || (product) == (P_M65_PRO) || (product) == (P_SABRE_O) || (product) == (P_SABRE_L) || (product) == (P_SABRE_N) || (product) == (P_SCIMITAR))) #define IS_MOUSE_DEV(kb) IS_MOUSE((kb)->vendor, (kb)->product) // USB delays for when the keyboards get picky about timing diff --git a/src/ckb-daemon/usb_linux.c b/src/ckb-daemon/usb_linux.c index 05feadc5..dce75e87 100644 --- a/src/ckb-daemon/usb_linux.c +++ b/src/ckb-daemon/usb_linux.c @@ -365,6 +365,7 @@ static _model models[] = { { P_STRAFE_NRGB_STR, P_STRAFE_NRGB }, // Mice { P_M65_STR, P_M65 }, + { P_M65_PRO_STR, P_M65_PRO }, { P_SABRE_O_STR, P_SABRE_O }, { P_SABRE_L_STR, P_SABRE_L }, { P_SABRE_N_STR, P_SABRE_N }, diff --git a/src/ckb-daemon/usb_mac.c b/src/ckb-daemon/usb_mac.c index 11e11185..0fe22ab8 100644 --- a/src/ckb-daemon/usb_mac.c +++ b/src/ckb-daemon/usb_mac.c @@ -772,7 +772,7 @@ int usbmain(){ // Keyboards P_K65, P_K65_LUX, P_K65_RFIRE, P_K70, P_K70_NRGB, P_K70_LUX, P_K70_RFIRE, P_K95, P_K95_NRGB, P_STRAFE, P_STRAFE_NRGB, // Mice - P_M65, P_SABRE_O, P_SABRE_L, P_SABRE_N, P_SCIMITAR + P_M65, P_M65_PRO, P_SABRE_O, P_SABRE_L, P_SABRE_N, P_SCIMITAR }; // Setup global variables