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 committed Feb 26, 2023
1 parent 325c96a commit d4fcfb3
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 @@ -80,6 +80,7 @@
#define USB_DEVICE_ID_RAZER_HUNTSMAN_V2 0x026c
#define USB_DEVICE_ID_RAZER_HUNTSMAN_V2_TKL 0x026b
#define USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_MINI_WIRELESS 0x0271
#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 @@ -343,6 +343,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 @@ -414,6 +415,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 @@ -474,6 +476,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 @@ -547,6 +550,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 @@ -688,6 +692,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 @@ -965,6 +970,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 @@ -1162,6 +1168,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 @@ -1386,6 +1393,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 @@ -1468,6 +1476,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 @@ -1550,6 +1559,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 @@ -1673,6 +1683,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 @@ -1764,6 +1775,7 @@ static int razer_get_report(IOUSBDeviceInterface **usb_dev, struct razer_report
case USB_DEVICE_ID_RAZER_HUNTSMAN_V2:
case USB_DEVICE_ID_RAZER_HUNTSMAN_V2_TKL:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_MINI_WIRED:
case USB_DEVICE_ID_RAZER_DEATHSTALKER_V2:
report_index = 0x03;
response_index = 0x03;
break;
Expand Down

0 comments on commit d4fcfb3

Please sign in to comment.