aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias von Arx <[email protected]>2024-03-29 22:00:33 +0100
committerMatthias von Arx <[email protected]>2024-03-29 22:00:33 +0100
commit89a3c549e36c83bc7e45971a83361ea3df20912e (patch)
treefcdb8650235fd9d9f22b182c67a043fdab5b9200 /src
parent325c96a62afd87debbaf4f51d8c9f569e45657bb (diff)
downloadlibrazermacos-89a3c549e36c83bc7e45971a83361ea3df20912e.tar.xz
librazermacos-89a3c549e36c83bc7e45971a83361ea3df20912e.zip
added Naga_X support
Diffstat (limited to 'src')
-rw-r--r--src/include/razermouse_driver.h1
-rwxr-xr-xsrc/lib/razerdevice.c1
-rw-r--r--src/lib/razermouse_driver.c17
3 files changed, 19 insertions, 0 deletions
diff --git a/src/include/razermouse_driver.h b/src/include/razermouse_driver.h
index a94b02b..7c53275 100644
--- a/src/include/razermouse_driver.h
+++ b/src/include/razermouse_driver.h
@@ -53,6 +53,7 @@
#define USB_DEVICE_ID_RAZER_BASILISK_ULTIMATE_RECEIVER 0x0088
#define USB_DEVICE_ID_RAZER_NAGA_TRINITY 0x0067
#define USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS 0x0090
+#define USB_DEVICE_ID_RAZER_NAGA_X 0x0096
#define USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED 0x008F
#define USB_DEVICE_ID_RAZER_ABYSSUS_ELITE_DVA_EDITION 0x006A
#define USB_DEVICE_ID_RAZER_ABYSSUS_ESSENTIAL 0x006B
diff --git a/src/lib/razerdevice.c b/src/lib/razerdevice.c
index 8a3c3ce..bebc8b0 100755
--- a/src/lib/razerdevice.c
+++ b/src/lib/razerdevice.c
@@ -93,6 +93,7 @@ bool is_mouse(IOUSBDeviceInterface **usb_dev)
case USB_DEVICE_ID_RAZER_DEATHADDER_1800:
case USB_DEVICE_ID_RAZER_OROCHI_2013:
case USB_DEVICE_ID_RAZER_NAGA_2014:
+ case USB_DEVICE_ID_RAZER_NAGA_X:
case USB_DEVICE_ID_RAZER_NAGA_HEX:
case USB_DEVICE_ID_RAZER_ABYSSUS:
case USB_DEVICE_ID_RAZER_DEATHADDER_CHROMA:
diff --git a/src/lib/razermouse_driver.c b/src/lib/razermouse_driver.c
index 8f2e4c3..5c557cd 100644
--- a/src/lib/razermouse_driver.c
+++ b/src/lib/razermouse_driver.c
@@ -76,6 +76,7 @@ static int razer_get_report(IOUSBDeviceInterface **usb_dev, struct razer_report
return razer_get_usb_response(usb_dev, index, request_report, index, response_report, RAZER_VIPER_MOUSE_RECEIVER_WAIT_MIN_US);
break;
+ case USB_DEVICE_ID_RAZER_NAGA_X:
case USB_DEVICE_ID_RAZER_BASILISK_V3:
index = 0x03;
return razer_get_usb_response(usb_dev, index, request_report, index, response_report, RAZER_NEW_MOUSE_RECEIVER_WAIT_MIN_US);
@@ -340,6 +341,7 @@ ssize_t razer_attr_write_side_mode_spectrum(IOUSBDeviceInterface **usb_dev, cons
break;
case USB_DEVICE_ID_RAZER_MAMBA_ELITE:
+ case USB_DEVICE_ID_RAZER_NAGA_X:
case USB_DEVICE_ID_RAZER_BASILISK_V2:
report = razer_chroma_extended_matrix_effect_spectrum(VARSTORE, side);
report.transaction_id.id = 0x1f;
@@ -404,6 +406,7 @@ ssize_t razer_attr_write_side_mode_breath(IOUSBDeviceInterface **usb_dev, const
case USB_DEVICE_ID_RAZER_VIPER_MINI:
case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED:
case USB_DEVICE_ID_RAZER_NAGA_TRINITY:
+ case USB_DEVICE_ID_RAZER_NAGA_X:
case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS:
case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED:
case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS:
@@ -433,6 +436,7 @@ ssize_t razer_attr_write_side_mode_breath(IOUSBDeviceInterface **usb_dev, const
switch(product) {
case USB_DEVICE_ID_RAZER_MAMBA_ELITE:
case USB_DEVICE_ID_RAZER_BASILISK_V2:
+ case USB_DEVICE_ID_RAZER_NAGA_X:
report.transaction_id.id = 0x1f;
break;
@@ -476,6 +480,7 @@ ssize_t razer_attr_write_side_mode_none(IOUSBDeviceInterface **usb_dev, const ch
case USB_DEVICE_ID_RAZER_VIPER_MINI:
case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED:
case USB_DEVICE_ID_RAZER_NAGA_TRINITY:
+ case USB_DEVICE_ID_RAZER_NAGA_X:
case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS:
case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED:
case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS:
@@ -732,6 +737,7 @@ ssize_t razer_attr_write_scroll_mode_static(IOUSBDeviceInterface **usb_dev, cons
break;
case USB_DEVICE_ID_RAZER_MAMBA_ELITE:
+ case USB_DEVICE_ID_RAZER_NAGA_X:
case USB_DEVICE_ID_RAZER_BASILISK_V2:
case USB_DEVICE_ID_RAZER_BASILISK_V3:
report = razer_chroma_extended_matrix_effect_static(VARSTORE, SCROLL_WHEEL_LED, (struct razer_rgb*)&buf[0]);
@@ -1543,6 +1549,7 @@ ssize_t razer_attr_write_logo_mode_reactive(IOUSBDeviceInterface **usb_dev, cons
break;
case USB_DEVICE_ID_RAZER_MAMBA_ELITE:
+ case USB_DEVICE_ID_RAZER_NAGA_X:
case USB_DEVICE_ID_RAZER_BASILISK_V2:
report = razer_chroma_extended_matrix_effect_reactive(VARSTORE, LOGO_LED, speed, (struct razer_rgb*)&buf[1]);
report.transaction_id.id = 0x1f;
@@ -1809,6 +1816,7 @@ ushort razer_attr_read_poll_rate(IOUSBDeviceInterface **usb_dev)
break;
case USB_DEVICE_ID_RAZER_NAGA_LEFT_HANDED_2020:
+ case USB_DEVICE_ID_RAZER_NAGA_X:
case USB_DEVICE_ID_RAZER_ATHERIS_RECEIVER:
case USB_DEVICE_ID_RAZER_BASILISK_V2:
case USB_DEVICE_ID_RAZER_BASILISK_V3:
@@ -1902,6 +1910,7 @@ void razer_attr_write_poll_rate(IOUSBDeviceInterface **usb_dev, ushort polling_r
break;
case USB_DEVICE_ID_RAZER_NAGA_LEFT_HANDED_2020:
+ case USB_DEVICE_ID_RAZER_NAGA_X:
case USB_DEVICE_ID_RAZER_ATHERIS_RECEIVER:
case USB_DEVICE_ID_RAZER_BASILISK_V2:
case USB_DEVICE_ID_RAZER_BASILISK_V3:
@@ -1944,6 +1953,7 @@ void razer_attr_write_matrix_brightness(IOUSBDeviceInterface **usb_dev, unsigned
break;
case USB_DEVICE_ID_RAZER_NAGA_LEFT_HANDED_2020:
+ case USB_DEVICE_ID_RAZER_NAGA_X:
case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS:
case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED:
case USB_DEVICE_ID_RAZER_MAMBA_ELITE:
@@ -1996,6 +2006,7 @@ ushort razer_attr_read_matrix_brightness(IOUSBDeviceInterface **usb_dev)
break;
case USB_DEVICE_ID_RAZER_NAGA_LEFT_HANDED_2020:
+ case USB_DEVICE_ID_RAZER_NAGA_X:
case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS:
case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED:
case USB_DEVICE_ID_RAZER_MAMBA_ELITE:
@@ -2042,6 +2053,7 @@ ushort razer_attr_read_scroll_led_brightness(IOUSBDeviceInterface **usb_dev)
break;
case USB_DEVICE_ID_RAZER_NAGA_LEFT_HANDED_2020:
+ case USB_DEVICE_ID_RAZER_NAGA_X:
case USB_DEVICE_ID_RAZER_MAMBA_ELITE:
case USB_DEVICE_ID_RAZER_BASILISK_V2:
case USB_DEVICE_ID_RAZER_BASILISK_V3:
@@ -2094,6 +2106,7 @@ void razer_attr_write_scroll_led_brightness(IOUSBDeviceInterface **usb_dev, unsi
break;
case USB_DEVICE_ID_RAZER_NAGA_LEFT_HANDED_2020:
+ case USB_DEVICE_ID_RAZER_NAGA_X:
case USB_DEVICE_ID_RAZER_MAMBA_ELITE:
case USB_DEVICE_ID_RAZER_BASILISK_V2:
case USB_DEVICE_ID_RAZER_BASILISK_V3:
@@ -2143,6 +2156,7 @@ ushort razer_attr_read_logo_led_brightness(IOUSBDeviceInterface **usb_dev)
break;
case USB_DEVICE_ID_RAZER_NAGA_LEFT_HANDED_2020:
+ case USB_DEVICE_ID_RAZER_NAGA_X:
case USB_DEVICE_ID_RAZER_MAMBA_ELITE:
case USB_DEVICE_ID_RAZER_BASILISK_V2:
case USB_DEVICE_ID_RAZER_BASILISK_V3:
@@ -2205,6 +2219,7 @@ void razer_attr_write_logo_led_brightness(IOUSBDeviceInterface **usb_dev, unsign
break;
case USB_DEVICE_ID_RAZER_NAGA_LEFT_HANDED_2020:
+ case USB_DEVICE_ID_RAZER_NAGA_X:
case USB_DEVICE_ID_RAZER_MAMBA_ELITE:
case USB_DEVICE_ID_RAZER_BASILISK_V2:
case USB_DEVICE_ID_RAZER_BASILISK_V3:
@@ -2264,6 +2279,7 @@ ushort razer_attr_read_side_led_brightness(IOUSBDeviceInterface **usb_dev, int s
break;
case USB_DEVICE_ID_RAZER_NAGA_LEFT_HANDED_2020:
+ case USB_DEVICE_ID_RAZER_NAGA_X:
case USB_DEVICE_ID_RAZER_MAMBA_ELITE:
report = razer_chroma_extended_matrix_get_brightness(VARSTORE, side);
report.transaction_id.id = 0x1f;
@@ -2303,6 +2319,7 @@ void razer_attr_write_side_led_brightness(IOUSBDeviceInterface **usb_dev, unsign
break;
case USB_DEVICE_ID_RAZER_NAGA_LEFT_HANDED_2020:
+ case USB_DEVICE_ID_RAZER_NAGA_X:
case USB_DEVICE_ID_RAZER_MAMBA_ELITE:
report = razer_chroma_extended_matrix_brightness(VARSTORE, side, brightness);
report.transaction_id.id = 0x1f;