Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Razer Blade 14 (2024) #2241

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ The devices below are fully feature supported by OpenRazer, which means all avai
| Razer Blade 18 (2023) | 1532:02A0 |
| Razer Ornata V3 | 1532:02A1 |
| Razer Ornata V3 X | 1532:02A2 |
| Razer Blade 14 (2024) | 1532:02B6 |
| Razer BlackWidow V3 Tenkeyless | 1532:0A24 |

### Mice
Expand Down
19 changes: 19 additions & 0 deletions daemon/openrazer_daemon/hardware/keyboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -1938,6 +1938,25 @@ class RazerBlade142023(_RippleKeyboard):
DEVICE_IMAGE = "https://dl.razerzone.com/src2/13031/13031-1-en-v2.png"


class RazerBlade142024(_RippleKeyboard):
"""
Class for the Razer Blade 14 (2024)
"""
EVENT_FILE_REGEX = re.compile(r'.*Razer_Blade(-if01)?-event-kbd')

USB_VID = 0x1532
USB_PID = 0x02B6
HAS_MATRIX = True
MATRIX_DIMS = [6, 16]
METHODS = ['get_device_type_keyboard', 'get_logo_active', 'set_logo_active', 'set_wave_effect', 'set_static_effect', 'set_spectrum_effect',
'set_reactive_effect', 'set_none_effect', 'set_breath_random_effect', 'set_breath_single_effect',
'set_breath_dual_effect', 'set_custom_effect', 'set_key_row',
'set_starlight_random_effect', 'set_starlight_single_effect', 'set_starlight_dual_effect',
'set_ripple_effect', 'set_ripple_effect_random_colour']

DEVICE_IMAGE = "https://dl.razerzone.com/src2/13031/13031-1-en-v2.png"


class RazerBlade152023(_RippleKeyboard):
"""
Class for the Razer Blade 15 (2023)
Expand Down
9 changes: 9 additions & 0 deletions driver/razerkbd_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ static bool is_blade_laptop(struct razer_kbd_device *device)
case USB_DEVICE_ID_RAZER_BLADE_14_2022:
case USB_DEVICE_ID_RAZER_BLADE_15_ADV_EARLY_2022:
case USB_DEVICE_ID_RAZER_BLADE_14_2023:
case USB_DEVICE_ID_RAZER_BLADE_14_2024:
case USB_DEVICE_ID_RAZER_BLADE_15_2023:
case USB_DEVICE_ID_RAZER_BLADE_16_2023:
case USB_DEVICE_ID_RAZER_BLADE_18_2023:
Expand Down Expand Up @@ -1148,6 +1149,10 @@ static ssize_t razer_attr_read_device_type(struct device *dev, struct device_att
device_type = "Razer Blade 14 (2023)\n";
break;

case USB_DEVICE_ID_RAZER_BLADE_14_2024:
device_type = "Razer Blade 14 (2024)\n";
break;

case USB_DEVICE_ID_RAZER_BLADE_15_2023:
device_type = "Razer Blade 15 (2023)\n";
break;
Expand Down Expand Up @@ -1982,6 +1987,7 @@ static ssize_t razer_attr_write_matrix_effect_static(struct device *dev, struct
case USB_DEVICE_ID_RAZER_BLADE_15_2023:
case USB_DEVICE_ID_RAZER_BLADE_16_2023:
case USB_DEVICE_ID_RAZER_BLADE_18_2023:
case USB_DEVICE_ID_RAZER_BLADE_14_2024:
if (count != 3) {
printk(KERN_WARNING "razerkbd: Static mode only accepts RGB (3byte)\n");
return -EINVAL;
Expand Down Expand Up @@ -4106,6 +4112,7 @@ static int razer_kbd_probe(struct hid_device *hdev, const struct hid_device_id *
case USB_DEVICE_ID_RAZER_BLADE_15_2023:
case USB_DEVICE_ID_RAZER_BLADE_16_2023:
case USB_DEVICE_ID_RAZER_BLADE_18_2023:
case USB_DEVICE_ID_RAZER_BLADE_14_2024:
CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect
CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect
CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect
Expand Down Expand Up @@ -4573,6 +4580,7 @@ static void razer_kbd_disconnect(struct hid_device *hdev)
case USB_DEVICE_ID_RAZER_BLADE_15_2023:
case USB_DEVICE_ID_RAZER_BLADE_16_2023:
case USB_DEVICE_ID_RAZER_BLADE_18_2023:
case USB_DEVICE_ID_RAZER_BLADE_14_2024:
device_remove_file(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect
device_remove_file(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect
device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect
Expand Down Expand Up @@ -4743,6 +4751,7 @@ static const struct hid_device_id razer_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLADE_15_ADV_EARLY_2022) },
{ HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLADE_14_2023) },
{ HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLADE_15_2023) },
{ HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLADE_14_2024) },
{ HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_DEATHSTALKER_V2) },
{ HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_DEATHSTALKER_V2_PRO_WIRED) },
{ HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_DEATHSTALKER_V2_PRO_WIRELESS) },
Expand Down
1 change: 1 addition & 0 deletions driver/razerkbd_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
#define USB_DEVICE_ID_RAZER_BLADE_18_2023 0x02A0
#define USB_DEVICE_ID_RAZER_ORNATA_V3 0x02A1
#define USB_DEVICE_ID_RAZER_ORNATA_V3_X_ALT 0x02A2
#define USB_DEVICE_ID_RAZER_BLADE_14_2024 0x02B6
#define USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_TK 0x0A24

/* Each keyboard report has 90 bytes*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
<modalias>usb:v1532p02A0d*</modalias>
<modalias>usb:v1532p02A1d*</modalias>
<modalias>usb:v1532p02A2d*</modalias>
<modalias>usb:v1532p02B6d*</modalias>
<modalias>usb:v1532p0501d*</modalias>
<modalias>usb:v1532p0504d*</modalias>
<modalias>usb:v1532p0506d*</modalias>
Expand Down
2 changes: 1 addition & 1 deletion install_files/udev/99-razer.rules
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ATTRS{idProduct}=="0013|0016|0020|0024|0025|0029|002e|002f|0032|0034|0036|0037|0
ENV{ID_RAZER_CHROMA}="1", ENV{RAZER_DRIVER}="razermouse"

# Keyboards
ATTRS{idProduct}=="010d|010e|010f|0111|0113|0118|011a|011b|011c|0201|0202|0203|0204|0205|0207|0208|0209|020f|0210|0211|0214|0216|0217|021a|021e|021f|0220|0221|0224|0225|0226|0227|0228|022a|022b|022c|022d|022f|0232|0233|0234|0235|0237|0239|023a|023b|023f|0240|0241|0243|0245|0246|024a|024b|024c|024d|024e|0252|0253|0255|0256|0257|0258|0259|025a|025d|025e|0266|0269|026a|026b|026c|026d|026e|026f|0270|0271|0276|0279|027a|0282|0287|028a|028b|028c|028d|0290|0292|0294|0295|0296|0298|029d|029e|029f|02a0|02a1|02a2|0a24", \
ATTRS{idProduct}=="010d|010e|010f|0111|0113|0118|011a|011b|011c|0201|0202|0203|0204|0205|0207|0208|0209|020f|0210|0211|0214|0216|0217|021a|021e|021f|0220|0221|0224|0225|0226|0227|0228|022a|022b|022c|022d|022f|0232|0233|0234|0235|0237|0239|023a|023b|023f|0240|0241|0243|0245|0246|024a|024b|024c|024d|024e|0252|0253|0255|0256|0257|0258|0259|025a|025d|025e|0266|0269|026a|026b|026c|026d|026e|026f|0270|0271|0276|0279|027a|0282|0287|028a|028b|028c|028d|0290|0292|0294|0295|0296|0298|029d|029e|029f|02a0|02a1|02a2|02b6|0a24", \
ATTRS{idVendor}=="1532", \
ENV{ID_RAZER_CHROMA}="1", ENV{RAZER_DRIVER}="razerkbd"

Expand Down
22 changes: 22 additions & 0 deletions pylib/openrazer/_fake_driver/razerblade142024.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# DO NOT EDIT THIS FILE!
# You can regenerate all fake driver files with ./scripts/generate_all_fake_drivers.sh -f
[device]
dir_name = 0003:1532:02B6.0001
name = Razer Blade 14 (2024)
files = rw,device_mode,0x0000
r,device_serial,XX00000002B6
r,device_type,%(name)s
r,firmware_version,v1.0
r,kbd_layout,01
rw,logo_led_state,0
rw,matrix_brightness,0
w,matrix_custom_frame
w,matrix_effect_breath
w,matrix_effect_custom
w,matrix_effect_none
w,matrix_effect_reactive
w,matrix_effect_spectrum
w,matrix_effect_starlight
w,matrix_effect_static
w,matrix_effect_wave
r,version,1.0.0