Skip to content

Commit fae039e

Browse files
committed
Support for optical Sabre mice
1 parent df366d0 commit fae039e

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
beta-v0.2.2+t02
1+
beta-v0.2.2+t03

src/ckb-daemon/usb.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const char* product_str(short product){
3434
return "strafe";
3535
if(product == P_M65)
3636
return "m65";
37-
if(product == P_SABRE)
37+
if(product == P_SABRE_O || product == P_SABRE_L)
3838
return "sabre";
3939
if(product == P_SCIMITAR)
4040
return "scimitar";

src/ckb-daemon/usb.h

+6-4
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@
3434
#define P_M65_STR "1b12"
3535
#define IS_M65(kb) ((kb)->vendor == V_CORSAIR && ((kb)->product == P_M65))
3636

37-
#define P_SABRE 0x1b19
38-
#define P_SABRE_STR "1b19"
39-
#define IS_SABRE(kb) ((kb)->vendor == V_CORSAIR && ((kb)->product == P_SABRE))
37+
#define P_SABRE_O 0x1b14
38+
#define P_SABRE_O_STR "1b14"
39+
#define P_SABRE_L 0x1b19
40+
#define P_SABRE_L_STR "1b19"
41+
#define IS_SABRE(kb) ((kb)->vendor == V_CORSAIR && ((kb)->product == P_SABRE_O || (kb)->product == P_SABRE_L))
4042

4143
#define P_SCIMITAR 0x1b1e
4244
#define P_SCIMITAR_STR "1b1e"
@@ -57,7 +59,7 @@ const char* product_str(short product);
5759
#define IS_MONOCHROME(vendor, product) ((vendor) == (V_CORSAIR) && (product) == (P_STRAFE_NRGB))
5860

5961
// Mouse vs keyboard test
60-
#define IS_MOUSE(vendor, product) ((vendor) == (V_CORSAIR) && ((product) == (P_M65) || (product) == (P_SABRE) || (product) == (P_SCIMITAR)))
62+
#define IS_MOUSE(vendor, product) ((vendor) == (V_CORSAIR) && ((product) == (P_M65) || (product) == (P_SABRE_O) || (product) == (P_SABRE_L) || (product) == (P_SCIMITAR)))
6163

6264
// USB delays for when the keyboards get picky about timing
6365
#define DELAY_SHORT(kb) usleep((int)(kb)->usbdelay * 1000) // base (default: 5ms)

src/ckb-daemon/usb_linux.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ static _model models[] = {
341341
{ P_STRAFE_NRGB_STR, P_STRAFE_NRGB },
342342
// Mice
343343
{ P_M65_STR, P_M65 },
344-
{ P_SABRE_STR, P_SABRE },
344+
{ P_SABRE_O_STR, P_SABRE_O },
345+
{ P_SABRE_L_STR, P_SABRE_L },
345346
{ P_SCIMITAR_STR, P_SCIMITAR }
346347
};
347348
#define N_MODELS (sizeof(models) / sizeof(_model))

src/ckb-daemon/usb_mac.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ int usbmain(){
403403
// Keyboards
404404
P_K65, P_K70, P_K70_NRGB, P_K95, P_K95_NRGB, P_STRAFE, P_STRAFE_NRGB,
405405
// Mice
406-
P_M65, P_SABRE, P_SCIMITAR
406+
P_M65, P_SABRE_O, P_SABRE_L, P_SCIMITAR
407407
};
408408
// Tell IOService which type of devices we want (IOHIDDevices matching the supported vendor/products)
409409
CFMutableDictionaryRef match = IOServiceMatching(kIOHIDDeviceKey);

0 commit comments

Comments
 (0)