diff options
| author | mavonarx <[email protected]> | 2024-03-30 01:11:13 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-03-30 01:11:13 +0100 |
| commit | 9599fe40ca862e31d4948ada64917fdcb0154245 (patch) | |
| tree | 5e4b12f768a965dfa92b6fddf87ddbaf6de6b616 | |
| parent | 70873468fe0c56c3d3aa97f77f3347fa94be409a (diff) | |
| parent | 89a3c549e36c83bc7e45971a83361ea3df20912e (diff) | |
| download | librazermacos-9599fe40ca862e31d4948ada64917fdcb0154245.tar.xz librazermacos-9599fe40ca862e31d4948ada64917fdcb0154245.zip | |
Merge pull request #1 from mavonarx/naga_x_support
added Naga_X support
| -rw-r--r-- | src/include/razermouse_driver.h | 1 | ||||
| -rwxr-xr-x | src/lib/razerdevice.c | 1 | ||||
| -rw-r--r-- | src/lib/razermouse_driver.c | 17 |
3 files changed, 19 insertions, 0 deletions
diff --git a/src/include/razermouse_driver.h b/src/include/razermouse_driver.h index 7636cc3..3643bb4 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 04ff260..8a165c5 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 fed8686..55627a4 100644 --- a/src/lib/razermouse_driver.c +++ b/src/lib/razermouse_driver.c @@ -78,6 +78,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); @@ -348,6 +349,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; @@ -414,6 +416,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: @@ -443,6 +446,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; @@ -486,6 +490,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: @@ -750,6 +755,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: case USB_DEVICE_ID_RAZER_BASILISK_V3_PRO_WIRED: @@ -1573,6 +1579,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; @@ -1839,6 +1846,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: @@ -1934,6 +1942,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: @@ -1978,6 +1987,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: @@ -2030,6 +2040,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: @@ -2078,6 +2089,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: @@ -2132,6 +2144,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: @@ -2183,6 +2196,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: @@ -2247,6 +2261,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: @@ -2308,6 +2323,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; @@ -2349,6 +2365,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; |
