diff options
| author | Eduardo Almeida <[email protected]> | 2021-08-13 11:52:16 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-08-13 11:52:16 +0100 |
| commit | a5666117780abc895588a7b907f6e1b9614c38c3 (patch) | |
| tree | 902f3eb68e4f8dc68fdf629814af63a71df2bf3d | |
| parent | f6aa74b5c29ae7e56be7ed50f494528928e4fd99 (diff) | |
| parent | 2bf746ea12f54fe0cf14adb49de18d0fc2f33902 (diff) | |
| download | librazermacos-a5666117780abc895588a7b907f6e1b9614c38c3.tar.xz librazermacos-a5666117780abc895588a7b907f6e1b9614c38c3.zip | |
Merge pull request #9 from jvk75/master
Add support for Naga Pro.
| -rw-r--r-- | src/include/razermouse_driver.h | 4 | ||||
| -rwxr-xr-x | src/lib/razerdevice.c | 2 | ||||
| -rw-r--r-- | src/lib/razermouse_driver.c | 38 |
3 files changed, 43 insertions, 1 deletions
diff --git a/src/include/razermouse_driver.h b/src/include/razermouse_driver.h index 992de3a..d2e6dd1 100644 --- a/src/include/razermouse_driver.h +++ b/src/include/razermouse_driver.h @@ -51,6 +51,8 @@ #define USB_DEVICE_ID_RAZER_BASILISK_ULTIMATE 0x0086 #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_PRO_WIRED 0x008F #define USB_DEVICE_ID_RAZER_ABYSSUS_ELITE_DVA_EDITION 0x006A #define USB_DEVICE_ID_RAZER_ABYSSUS_ESSENTIAL 0x006B #define USB_DEVICE_ID_RAZER_MAMBA_ELITE 0x006C @@ -198,4 +200,4 @@ ssize_t razer_attr_write_logo_led_rgb(IOUSBDeviceInterface **usb_dev, const char ssize_t razer_attr_read_get_battery(IOUSBDeviceInterface **usb_dev, char *buf); ssize_t razer_attr_read_is_charging(IOUSBDeviceInterface **usb_dev, char *buf); -#endif
\ No newline at end of file +#endif diff --git a/src/lib/razerdevice.c b/src/lib/razerdevice.c index e77b5d1..8c4df51 100755 --- a/src/lib/razerdevice.c +++ b/src/lib/razerdevice.c @@ -108,6 +108,8 @@ bool is_mouse(IOUSBDeviceInterface **usb_dev) case USB_DEVICE_ID_RAZER_BASILISK_ULTIMATE: case USB_DEVICE_ID_RAZER_BASILISK_ULTIMATE_RECEIVER: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_ABYSSUS_ELITE_DVA_EDITION: case USB_DEVICE_ID_RAZER_ABYSSUS_ESSENTIAL: case USB_DEVICE_ID_RAZER_MAMBA_ELITE: diff --git a/src/lib/razermouse_driver.c b/src/lib/razermouse_driver.c index 68002d9..80a1bb7 100644 --- a/src/lib/razermouse_driver.c +++ b/src/lib/razermouse_driver.c @@ -56,6 +56,8 @@ static int razer_get_report(IOUSBDeviceInterface **usb_dev, struct razer_report case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_BASILISK_ULTIMATE_RECEIVER: return razer_get_usb_response(usb_dev, 0x00, request_report, 0x00, response_report, RAZER_NEW_MOUSE_RECEIVER_WAIT_MIN_US); break; @@ -173,6 +175,8 @@ ssize_t razer_attr_write_side_mode_static(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_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: case USB_DEVICE_ID_RAZER_BASILISK: case USB_DEVICE_ID_RAZER_BASILISK_ULTIMATE: @@ -233,6 +237,8 @@ ssize_t razer_attr_write_side_mode_static_no_store(IOUSBDeviceInterface **usb_de 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_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: case USB_DEVICE_ID_RAZER_BASILISK: case USB_DEVICE_ID_RAZER_BASILISK_ULTIMATE: @@ -290,6 +296,8 @@ ssize_t razer_attr_write_side_mode_spectrum(IOUSBDeviceInterface **usb_dev, cons 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_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -360,6 +368,8 @@ 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_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -429,6 +439,8 @@ 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_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -589,6 +601,8 @@ ssize_t razer_attr_write_logo_mode_static(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_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -658,6 +672,8 @@ ssize_t razer_attr_write_scroll_mode_static(IOUSBDeviceInterface **usb_dev, cons 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_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -750,6 +766,8 @@ ssize_t razer_attr_write_logo_mode_static_no_store(IOUSBDeviceInterface **usb_de case USB_DEVICE_ID_RAZER_VIPER_8KHZ: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + 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: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -822,6 +840,8 @@ ssize_t razer_attr_write_scroll_mode_static_no_store(IOUSBDeviceInterface **usb_ 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_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -908,6 +928,8 @@ ssize_t razer_attr_write_logo_mode_spectrum(IOUSBDeviceInterface **usb_dev, cons 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_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -967,6 +989,8 @@ ssize_t razer_attr_write_scroll_mode_spectrum(IOUSBDeviceInterface **usb_dev, co 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_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -1062,6 +1086,8 @@ ssize_t razer_attr_write_logo_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_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -1150,6 +1176,8 @@ ssize_t razer_attr_write_scroll_mode_breath(IOUSBDeviceInterface **usb_dev, cons 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_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -1243,6 +1271,8 @@ ssize_t razer_attr_write_logo_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_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -1305,6 +1335,8 @@ ssize_t razer_attr_write_scroll_mode_none(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_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -1434,6 +1466,8 @@ ssize_t razer_attr_write_logo_mode_reactive(IOUSBDeviceInterface **usb_dev, cons 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_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -1826,6 +1860,8 @@ 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_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_MAMBA_ELITE: report = razer_chroma_extended_matrix_brightness(VARSTORE, 0x00, brightness); report.transaction_id.id = 0x1F; @@ -1875,6 +1911,8 @@ 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_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_MAMBA_ELITE: report = razer_chroma_extended_matrix_get_brightness(VARSTORE, 0x00); report.transaction_id.id = 0x1F; |
