Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
beta-v0.2.6
beta-v0.2.6+d01
2 changes: 1 addition & 1 deletion src/ckb-daemon/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ int readcmd(usbdevice* kb, const char* line){
uint framerate;
if(sscanf(word, "%u", &framerate) == 1 && framerate > 0){
// Not all devices require the same number of messages per frame; select delay appropriately
uint per_frame = IS_MOUSE_DEV(kb) ? 2 : IS_STRAFE(kb) ? 14 : 5;
uint per_frame = IS_MOUSE_DEV(kb) ? 2 : IS_FULLRANGE(kb) ? 14 : 5;
uint delay = 1000 / framerate / per_frame;
if(delay < 2)
delay = 2;
Expand Down
2 changes: 1 addition & 1 deletion src/ckb-daemon/led_keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int updatergb_kb(usbdevice* kb, int force){
return 0;
lastlight->forceupdate = newlight->forceupdate = 0;

if(IS_STRAFE(kb)){
if(IS_FULLRANGE(kb)){
// Update strafe sidelights if necessary
if(lastlight->sidelight != newlight->sidelight) {
uchar data_pkt[2][MSG_SIZE] = {
Expand Down
8 changes: 4 additions & 4 deletions src/ckb-daemon/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ const char* vendor_str(short vendor){
const char* product_str(short product){
if(product == P_K95 || product == P_K95_NRGB)
return "k95";
if(product == P_K70 || product == P_K70_NRGB)
if(product == P_K70 || product == P_K70_NRGB || product == P_K70_LUX || product == P_K70_RFIRE)
return "k70";
if(product == P_K65)
if(product == P_K65 || product == P_K65_LUX || product == P_K65_RFIRE)
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)
if(product == P_SABRE_O || product == P_SABRE_L || product == P_SABRE_N)
return "sabre";
if(product == P_SCIMITAR)
return "scimitar";
Expand Down
29 changes: 22 additions & 7 deletions src/ckb-daemon/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@

#define P_K65 0x1b17
#define P_K65_STR "1b17"
#define IS_K65(kb) ((kb)->vendor == V_CORSAIR && (kb)->product == P_K65)
#define P_K65_LUX 0x1b37
#define P_K65_LUX_STR "1b37"
#define P_K65_RFIRE 0x1b39
#define P_K65_RFIRE_STR "1b39"
#define IS_K65(kb) ((kb)->vendor == V_CORSAIR && ((kb)->product == P_K65 || (kb)->product == P_K65_LUX || (kb)->product == P_K65_RFIRE))

#define P_K70 0x1b13
#define P_K70_STR "1b13"
#define P_K70_NRGB 0x1b09
#define P_K70_NRGB_STR "1b09"
#define IS_K70(kb) ((kb)->vendor == V_CORSAIR && ((kb)->product == P_K70 || (kb)->product == P_K70_NRGB))
#define P_K70_LUX 0x1b33
#define P_K70_LUX_STR "1b33"
#define P_K70_RFIRE 0x1b38
#define P_K70_RFIRE_STR "1b38"
#define IS_K70(kb) ((kb)->vendor == V_CORSAIR && ((kb)->product == P_K70 || (kb)->product == P_K70_NRGB || (kb)->product == P_K70_RFIRE || (kb)->product == P_K70_LUX))

#define P_K95 0x1b11
#define P_K95_STR "1b11"
Expand All @@ -32,13 +40,17 @@

#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
#define P_SABRE_O 0x1b14 /* optical */
#define P_SABRE_O_STR "1b14"
#define P_SABRE_L 0x1b19
#define P_SABRE_L 0x1b19 /* laser */
#define P_SABRE_L_STR "1b19"
#define IS_SABRE(kb) ((kb)->vendor == V_CORSAIR && ((kb)->product == P_SABRE_O || (kb)->product == P_SABRE_L))
#define P_SABRE_N 0x1b2f /* new? */
#define P_SABRE_N_STR "1b2f"
#define IS_SABRE(kb) ((kb)->vendor == V_CORSAIR && ((kb)->product == P_SABRE_O || (kb)->product == P_SABRE_L || (kb)->product == P_SABRE_N))

#define P_SCIMITAR 0x1b1e
#define P_SCIMITAR_STR "1b1e"
Expand All @@ -60,8 +72,11 @@ const char* product_str(short product);
#define IS_RGB_DEV(kb) IS_RGB((kb)->vendor, (kb)->product)
#define IS_MONOCHROME_DEV(kb) IS_MONOCHROME((kb)->vendor, (kb)->product)

// Full color range (16.8M) vs partial color range (512)
#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_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
Expand Down
6 changes: 6 additions & 0 deletions src/ckb-daemon/usb_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,16 +353,22 @@ typedef struct {
static _model models[] = {
// Keyboards
{ P_K65_STR, P_K65 },
{ P_K65_LUX_STR, P_K65_LUX },
{ P_K65_RFIRE_STR, P_K65_RFIRE },
{ P_K70_STR, P_K70 },
{ P_K70_NRGB_STR, P_K70_NRGB },
{ P_K70_LUX_STR, P_K70_LUX },
{ P_K70_RFIRE_STR, P_K70_RFIRE },
{ P_K95_STR, P_K95 },
{ P_K95_NRGB_STR, P_K95_NRGB },
{ P_STRAFE_STR, P_STRAFE },
{ 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 },
{ P_SCIMITAR_STR, P_SCIMITAR }
};
#define N_MODELS (sizeof(models) / sizeof(_model))
Expand Down
4 changes: 2 additions & 2 deletions src/ckb-daemon/usb_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,9 +770,9 @@ int usbmain(){
int vendor = V_CORSAIR;
int products[] = {
// Keyboards
P_K65, P_K70, P_K70_NRGB, P_K95, P_K95_NRGB, P_STRAFE, P_STRAFE_NRGB,
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_SCIMITAR
P_M65, P_M65_PRO, P_SABRE_O, P_SABRE_L, P_SABRE_N, P_SCIMITAR
};

// Setup global variables
Expand Down