Skip to content

Commit

Permalink
Deathstalker V2 Support, fixes 1kc#43
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael CC authored and Michae1CC committed Feb 7, 2024
1 parent 979cf25 commit 788be40
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/include/razerkbd_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
#define USB_DEVICE_ID_RAZER_HUNTSMAN_V2_TKL 0x026b
#define USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_MINI_WIRELESS 0x0271
#define USB_DEVICE_ID_RAZER_BLACKWIDOW_V4_75 0x02a5
#define USB_DEVICE_ID_RAZER_DEATHSTALKER_V2 0x0295

/* Each keyboard report has 90 bytes*/
#define RAZER_BLACKWIDOW_REPORT_LEN 0x5A
Expand Down
1 change: 1 addition & 0 deletions src/lib/razerdevice.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ bool is_keyboard(IOUSBDeviceInterface **usb_dev)
case USB_DEVICE_ID_RAZER_BLACKWIDOW_CHROMA:
case USB_DEVICE_ID_RAZER_DEATHSTALKER_EXPERT:
case USB_DEVICE_ID_RAZER_DEATHSTALKER_CHROMA:
case USB_DEVICE_ID_RAZER_DEATHSTALKER_V2:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_CHROMA_TE:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_X_CHROMA:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_X_CHROMA_TE:
Expand Down
12 changes: 12 additions & 0 deletions src/lib/razerkbd_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ ssize_t razer_attr_write_mode_none(IOUSBDeviceInterface **usb_dev, const char *b
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_TK:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_PRO_WIRED:
case USB_DEVICE_ID_RAZER_HUNTSMAN_MINI:
case USB_DEVICE_ID_RAZER_DEATHSTALKER_V2:
report = razer_chroma_extended_matrix_effect_none(VARSTORE, BACKLIGHT_LED);
break;

Expand Down Expand Up @@ -416,6 +417,7 @@ ssize_t razer_attr_write_mode_wave(IOUSBDeviceInterface **usb_dev, const char *b
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_TK:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_PRO_WIRED:
case USB_DEVICE_ID_RAZER_HUNTSMAN_MINI:
case USB_DEVICE_ID_RAZER_DEATHSTALKER_V2:
report = razer_chroma_extended_matrix_effect_wave(VARSTORE, BACKLIGHT_LED, direction, speed);
break;

Expand Down Expand Up @@ -477,6 +479,7 @@ ssize_t razer_attr_write_mode_spectrum(IOUSBDeviceInterface **usb_dev, const cha
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_TK:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_PRO_WIRED:
case USB_DEVICE_ID_RAZER_HUNTSMAN_MINI:
case USB_DEVICE_ID_RAZER_DEATHSTALKER_V2:
report = razer_chroma_extended_matrix_effect_spectrum(VARSTORE, BACKLIGHT_LED);
break;

Expand Down Expand Up @@ -551,6 +554,7 @@ ssize_t razer_attr_write_mode_reactive(IOUSBDeviceInterface **usb_dev, const cha
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_TK:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_PRO_WIRED:
case USB_DEVICE_ID_RAZER_HUNTSMAN_MINI:
case USB_DEVICE_ID_RAZER_DEATHSTALKER_V2:
report = razer_chroma_extended_matrix_effect_reactive(VARSTORE, BACKLIGHT_LED, speed, (struct razer_rgb *)&buf[1]);
break;

Expand Down Expand Up @@ -693,6 +697,7 @@ ssize_t razer_attr_write_mode_static(IOUSBDeviceInterface **usb_dev, const char
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_TK:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_PRO_WIRED:
case USB_DEVICE_ID_RAZER_HUNTSMAN_MINI:
case USB_DEVICE_ID_RAZER_DEATHSTALKER_V2:
if (count == 3)
{
report = razer_chroma_extended_matrix_effect_static(VARSTORE, BACKLIGHT_LED, (struct razer_rgb *)&buf[0]);
Expand Down Expand Up @@ -972,6 +977,7 @@ ssize_t razer_attr_write_mode_starlight(IOUSBDeviceInterface **usb_dev, const ch
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_TK:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_PRO_WIRED:
case USB_DEVICE_ID_RAZER_HUNTSMAN_MINI:
case USB_DEVICE_ID_RAZER_DEATHSTALKER_V2:
if (count == 7)
{
report = razer_chroma_extended_matrix_effect_starlight_dual(VARSTORE, BACKLIGHT_LED, buf[0], (struct razer_rgb *)&buf[1], (struct razer_rgb *)&buf[4]);
Expand Down Expand Up @@ -1170,6 +1176,7 @@ ssize_t razer_attr_write_mode_breath(IOUSBDeviceInterface **usb_dev, const char
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_TK:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_PRO_WIRED:
case USB_DEVICE_ID_RAZER_HUNTSMAN_MINI:
case USB_DEVICE_ID_RAZER_DEATHSTALKER_V2:
switch (count)
{
case 3: // Single colour mode
Expand Down Expand Up @@ -1395,6 +1402,7 @@ ssize_t razer_attr_write_mode_custom(IOUSBDeviceInterface **usb_dev, const char
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_TK:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_PRO_WIRED:
case USB_DEVICE_ID_RAZER_HUNTSMAN_MINI:
case USB_DEVICE_ID_RAZER_DEATHSTALKER_V2:
report = razer_chroma_extended_matrix_effect_custom_frame();
break;

Expand Down Expand Up @@ -1478,6 +1486,7 @@ ssize_t razer_attr_write_set_brightness(IOUSBDeviceInterface **usb_dev, ushort b
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_TK:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_PRO_WIRED:
case USB_DEVICE_ID_RAZER_HUNTSMAN_MINI:
case USB_DEVICE_ID_RAZER_DEATHSTALKER_V2:
report = razer_chroma_extended_matrix_brightness(VARSTORE, BACKLIGHT_LED, brightness);
break;

Expand Down Expand Up @@ -1561,6 +1570,7 @@ ushort razer_attr_read_set_brightness(IOUSBDeviceInterface **usb_dev)
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_TK:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_PRO_WIRED:
case USB_DEVICE_ID_RAZER_HUNTSMAN_MINI:
case USB_DEVICE_ID_RAZER_DEATHSTALKER_V2:
report = razer_chroma_extended_matrix_get_brightness(VARSTORE, BACKLIGHT_LED);
is_matrix_brightness = true;
break;
Expand Down Expand Up @@ -1685,6 +1695,7 @@ ssize_t razer_attr_write_matrix_custom_frame(IOUSBDeviceInterface **usb_dev, con
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_TK:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_PRO_WIRED:
case USB_DEVICE_ID_RAZER_HUNTSMAN_MINI:
case USB_DEVICE_ID_RAZER_DEATHSTALKER_V2:
report = razer_chroma_extended_matrix_set_custom_frame(row_id, start_col, stop_col, (unsigned char *)&buf[offset]);
break;

Expand Down Expand Up @@ -1778,6 +1789,7 @@ static int razer_get_report(IOUSBDeviceInterface **usb_dev, struct razer_report
case USB_DEVICE_ID_RAZER_HUNTSMAN_V2_TKL:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_MINI_WIRED:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V4_75:
case USB_DEVICE_ID_RAZER_DEATHSTALKER_V2:
report_index = 0x03;
response_index = 0x03;
break;
Expand Down

0 comments on commit 788be40

Please sign in to comment.