Compare commits

..
55 Commits
Author SHA1 Message Date
morg 661218b4f1 Add razer kitty black edition PID 2022-01-13 19:13:54 +01:00
Frederik Madsen cb6b701b8d Add keymap for Razer Blade Pro 17 2021 2022-01-12 17:23:25 +00:00
Aurelien Labrosse c901144ede feat: detection of Asus TUF 3060TI 8G Gaming 2022-01-11 19:50:56 +01:00
Adam Honse b36af1b917 Add ASUS ROG Balteus Qi, also direct mode only for now as it shares the same controller 2022-01-10 21:15:39 -06:00
Adam Honse be3846cf8b Initial support for ASUS ROG Balteus mousemat (direct mode only for now) 2022-01-10 20:24:47 -06:00
morg c5364264b1 Add debug logs to corsair vengeance rgb pro 2022-01-09 20:18:05 +01:00
TheRogueZeta 85dcb31c5c Add EVGA RTX 2080 Super XC Ultra Devcie ID 2022-01-09 00:59:06 +00:00
TheRogueZeta 15a7c87056 Add Corsair NightSword VID and align detectors 2022-01-08 14:01:44 -08:00
morg 4281ada659 Add razer extras plugin link to readme 2022-01-08 07:36:59 +00:00
TheRogueZeta 8e44d59b6a Add ASUS ROG-STRIX-RTX2060-O6G-GAMING Device ID 2022-01-07 19:48:22 -08:00
Julien Nicoulaud 79272f9e2f add link to openrgb-rs (Rust SDK client) 2022-01-07 17:10:10 +00:00
morg 4d26af6422 Fix corsair k70 mk2 skipped keys. 2022-01-07 17:06:57 +00:00
TheRogueZeta d8637af917 Add ASUS ROG STRIX 3090 24G Gaming device ID 2022-01-05 14:44:45 -08:00
morg f89c56d864 Review TabLabel UI. Fix #2055 2022-01-04 18:57:40 +00:00
morg f4c4d13f6d Add support for Corsair K55 RGB PRO keyboard 2022-01-04 17:48:28 +00:00
morg b9407606bd Crucial static mode needs to be updated for color changes 2022-01-04 17:46:05 +00:00
alpemwarrior 165798628b SteelSeries rival: skip firmware check for unsupported models and add manual saving to more modes. 2022-01-04 17:43:55 +00:00
doctor64 a1dd83240d Fix out of range cycle in zone setup for Asrock Polychrome V1 boards 2022-01-03 20:00:31 +00:00
Chris 22cf62af29 Adding EVGA FTW3 2080S Hybrid 8G GPU
* Added card ID
* Registered detector in `EVGAGPUControllerDetect.cpp`
* Link to [webpage](https://au.evga.com/products/product.aspx?pn=08G-P4-3287-KR)
2022-01-03 23:57:29 +11:00
Thomas Amerongen 3b78a7bca9 Add support for Gigabyte RTX 3070 Eagle OC + color cycle option for all Gigabyte GPUs 2022-01-03 06:27:43 +00:00
Rebecca Wallander fd1af2f45d Add firmware getter to SteelSeries Controller 2022-01-02 20:08:19 +00:00
Érico Rolim 48d1a4f7b6 Don't use glibc specific function. 2022-01-02 20:01:01 +00:00
Chris c6bb160bfe Adding ISO \ to Logitech G815 mapping 2022-01-02 19:57:30 +00:00
Rebecca Wallander 7dba4e318a Simplify SteelSeries Rival 700 communication 2022-01-02 19:56:48 +00:00
TheEvilSkeleton 01eba8968b Add release 0.7 in appstream 2022-01-01 07:06:45 +00:00
Tomasz Torcz 2d8700c28d Add ASUS ROG STRIX RX560 Gaming id 2022-01-01 00:33:21 +00:00
Chris 09bae42c3b Fixing detection for the Razer Kitty Chroma to resolve #2066
+ Correcting another detector that relied on the IPU bug fixed in 3095572260
2022-01-01 10:26:16 +11:00
TheRogueZeta 72563a3883 Add Gigabyte AORUS 2080 8G device ID 2021-12-31 06:09:17 +00:00
Chris d6a9f664ff Initial commit for Razer Viper 8kHz to resolve #1755
* Adding entry for the Viper 8kHz PID
* Registered detectors
* Added metadata to RazerDevices.h
* Added capabilities to RazerController.cpp
* Added UDEV rule to 60-openrgb.rules
2021-12-31 04:49:19 +00:00
Chris de7abef0e9 Changed Logitech G733 detector to resolve #1235
* Changed Logitech G733 detector from Interface `2` to `3`
2021-12-31 04:46:47 +00:00
Chris 1d6e43d516 Initial commit for Razer Huntsman V2 to resolve #1999
* Adding entry for the Huntsman V2 PID
* Registered detectors
* Added metadata to RazerDevices.h
* Added capabilities to RazerController.cpp
* Added UDEV rule to 60-openrgb.rules
2021-12-31 15:13:48 +11:00
Adam Honse 914c4be553 Update timeout on Corsair Lighting Node controller 2021-12-31 03:51:24 +00:00
TheRogueZeta d7c08bcf91 Add NVIDIA 2080S device ID to the detector 2021-12-30 18:30:55 -06:00
Chris 2c70a4616c Adding ROG Strix 2060S 8G Gaming GPU
* Added card ID
* Registered detector in AsusAuraGPUControllerDetect.cpp
* Link to [webpage](https://rog.asus.com/graphics-cards/graphics-cards/rog-strix/rog-strix-rtx2060s-8g-gaming-model/)
2021-12-30 18:10:45 +00:00
Frederik Madsen b7a13c0285 Fixed incorrect IPU registration for the Razer BlackWidow v3 TKL 2021-12-30 18:10:13 +00:00
TheRogueZeta b03f0206ee Add Asus 2060 O6G Evo Gaming TU104 device ID 2021-12-30 08:13:12 +00:00
Adam Honse ee6e3d946c Increment version number post-release 2021-12-30 00:46:13 -06:00
Adam Honse 6128731df6 OpenRGB version 0.7 2021-12-30 00:45:07 -06:00
Adam Honse 6ca090d5f4 Use Bullseye OpenRGB builder image to build AppImages and Debian Bullseye .deb packages 2021-12-30 06:02:41 +00:00
Qwex 57e7e6a823 Revert "Fix frames skip when using external effects engine" to fix ram race condition 2021-12-30 06:00:59 +00:00
Brandon Shoopman bdecbd77fc Add support for Asus Rog Strix 3080 White LHR 2021-12-30 06:00:30 +00:00
Adam Honse 938f67016c Update plugin API to version 2, add unregister functions for all ResourceManager callbacks 2021-12-29 22:50:00 -06:00
Cooper Knaak 6d5ca0b539 Track used paths in DetectRazerARGBController to support multiple Razer ARGB controllers at once. 2021-12-30 01:08:23 +00:00
TheRogueZeta b877787e12 Update resize messages
Wording adjusted by Adam Honse <[email protected]>
2021-12-29 17:02:01 -06:00
Frederik Madsen 5186161fdd Support for wired and wireless BlackWidow V3 Mini 2021-12-29 18:35:54 +00:00
Adam Honse 341607ec3e Free allocated buffer in Linux pure i2c block transfer function 2021-12-29 03:48:19 -06:00
Adam Honse 46d8ca718e Fix pure i2c block read in Linux 2021-12-29 03:45:12 -06:00
Artem Polishchuk 101550bb6c Update RPM .spec file due MR#933 2021-12-29 03:19:49 -06:00
Artem Polishchuk ccbe83919a Fix udev rules install path
Need for Flatpak build and probably useful for other distros like Fedora.
2021-12-29 03:18:12 -06:00
Chris 6e7a59a8d9 Initial commit for Corsair M65 to resolve #1687
+ Adding entry for the Corsair M65 PID (non pro)
+ Registered detector
+ Added UDEV rule to 60-openrgb.rules
2021-12-29 16:56:41 +11:00
morg 84c21919e1 Add support for a RTX2080Ti 11G Gaming variant 2021-12-29 05:09:23 +00:00
Mola19 c6c4e76e04 Fixing bugs in ASUS Aura Mouse Controller
Commit amended for code style by Adam Honse <[email protected]>
2021-12-27 21:58:41 -06:00
Chris be1b982d71 Initial commit for Razer Huntsman V2 TKL
* Adding entry for the Huntsman V2 TKL PID
* Registered detectors
* Added metadata to RazerDevices.h
* Added capabilities to RazerController.cpp
* Added UDEV rule to 60-openrgb.rules
2021-12-27 15:53:05 -06:00
Frederik Madsen c362719771 Added support for the Razer Huntsman V2 Analog 2021-12-27 21:07:32 +00:00
Neneya 35a827d25c Implement new protocol version that adds tracking of keyboard-internal LED IDs rather than assuming they are in the same order as in OpenRGB, as well as sending the LED ID that needs to be updated on every direct update. 2021-12-27 05:12:39 +00:00
72 changed files with 3512 additions and 396 deletions
+106 -161
View File
@@ -32,7 +32,7 @@ before_script:
#-----------------------------------------------------------------------#
"Linux 32 AppImage":
<<: *ccache_init
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:buster-32
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bullseye-32
stage: build
script:
- export $(dpkg-architecture)
@@ -51,7 +51,7 @@ before_script:
#-----------------------------------------------------------------------#
"Linux 64 AppImage":
<<: *ccache_init
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:buster-64
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bullseye-64
stage: build
script:
- export $(dpkg-architecture)
@@ -66,9 +66,9 @@ before_script:
expire_in: 30 days
#-----------------------------------------------------------------------#
# Linux (.deb) 32-bit Build Target #
# Linux (.deb) Debian Buster (Legacy) 32-bit Build Target #
#-----------------------------------------------------------------------#
"Linux 32 deb":
"Linux 32 .deb (Debian Buster)":
<<: *ccache_init
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:buster-32
stage: build
@@ -87,9 +87,9 @@ before_script:
expire_in: 30 days
#-----------------------------------------------------------------------#
# Linux (.deb) 64-bit Build Target #
# Linux (.deb) Debian Buster (Legacy) 64-bit Build Target #
#-----------------------------------------------------------------------#
"Linux 64 deb":
"Linux 64 .deb (Debian Buster)":
<<: *ccache_init
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:buster-64
stage: build
@@ -107,6 +107,48 @@ before_script:
- openrgb-dbgsym*.deb
expire_in: 30 days
#-----------------------------------------------------------------------#
# Linux (.deb) Debian Bullseye 32-bit Build Target #
#-----------------------------------------------------------------------#
"Linux 32 .deb (Debian Bullseye)":
<<: *ccache_init
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bullseye-32
stage: build
script:
- dpkg-architecture -l
- dpkg-buildpackage --target-arch i386 -us -B
- rm -v ../openrgb-dbgsym*.deb
- mv -v ../openrgb*.deb ./
artifacts:
name: "${CI_PROJECT_NAME}_Linux_32_deb_${CI_COMMIT_SHORT_SHA}"
paths:
- openrgb*.deb
exclude:
- openrgb-dbgsym*.deb
expire_in: 30 days
#-----------------------------------------------------------------------#
# Linux (.deb) Debian Bullseye 64-bit Build Target #
#-----------------------------------------------------------------------#
"Linux 64 .deb (Debian Bullseye)":
<<: *ccache_init
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bullseye-64
stage: build
script:
- dpkg-architecture -l
- dpkg-buildpackage -us -B
- rm -v ../openrgb-dbgsym*.deb
- mv -v ../openrgb*.deb ./
artifacts:
name: "${CI_PROJECT_NAME}_Linux_64_deb_${CI_COMMIT_SHORT_SHA}"
paths:
- openrgb*.deb
exclude:
- openrgb-dbgsym*.deb
expire_in: 30 days
#-----------------------------------------------------------------------#
# Linux (.rpm) 64-bit Build Target #
#-----------------------------------------------------------------------#
@@ -133,52 +175,6 @@ before_script:
paths:
- openrgb*.rpm
expire_in: 30 days
#-----------------------------------------------------------------------#
# Linux (.deb) Debian Bullseye 32-bit Build Target #
#-----------------------------------------------------------------------#
"Linux 32 deb Bullseye":
<<: *ccache_init
image: i386/debian:bullseye
stage: build
script:
- apt update
- apt install -y build-essential qtcreator qtbase5-dev libusb-1.0-0-dev libhidapi-dev libmbedtls-dev pkgconf wget git file debhelper
- dpkg-architecture -l
- dpkg-buildpackage --target-arch i386 -us -B
- rm -v ../openrgb-dbgsym*.deb
- mv -v ../openrgb*.deb ./
artifacts:
name: "${CI_PROJECT_NAME}_Linux_32_deb_${CI_COMMIT_SHORT_SHA}"
paths:
- openrgb*.deb
exclude:
- openrgb-dbgsym*.deb
expire_in: 30 days
#-----------------------------------------------------------------------#
# Linux (.deb) Debian Bullseye 64-bit Build Target #
#-----------------------------------------------------------------------#
"Linux 64 deb Bullseye":
<<: *ccache_init
image: debian:bullseye
stage: build
script:
- apt update
- apt install -y build-essential qtcreator qtbase5-dev libusb-1.0-0-dev libhidapi-dev libmbedtls-dev pkgconf wget git file debhelper
- dpkg-architecture -l
- dpkg-buildpackage -us -B
- rm -v ../openrgb-dbgsym*.deb
- mv -v ../openrgb*.deb ./
artifacts:
name: "${CI_PROJECT_NAME}_Linux_64_deb_${CI_COMMIT_SHORT_SHA}"
paths:
- openrgb*.deb
exclude:
- openrgb-dbgsym*.deb
expire_in: 30 days
#-----------------------------------------------------------------------#
# Debian 32 Buster test #
@@ -193,9 +189,26 @@ before_script:
- openrgb -l
- apt remove -y openrgb
dependencies:
- "Linux 32 deb"
- "Linux 32 .deb (Debian Buster)"
needs:
- "Linux 32 deb"
- "Linux 32 .deb (Debian Buster)"
#-----------------------------------------------------------------------#
# Debian 64 Buster test #
#-----------------------------------------------------------------------#
"Debian 64 Buster":
image: amd64/debian:buster
stage: test
script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
- openrgb --version
- openrgb -l
- apt remove -y openrgb
dependencies:
- "Linux 64 .deb (Debian Buster)"
needs:
- "Linux 64 .deb (Debian Buster)"
#-----------------------------------------------------------------------#
# Debian 32 Bullseye test #
@@ -210,66 +223,15 @@ before_script:
- openrgb -l
- apt remove -y openrgb
dependencies:
- "Linux 32 deb"
- "Linux 32 .deb (Debian Bullseye)"
needs:
- "Linux 32 deb"
# #-----------------------------------------------------------------------#
# # Ubuntu 32 18.04LTS test #
# #-----------------------------------------------------------------------#
# "Ubuntu 32 18.04LTS":
# image: i386/ubuntu:bionic
# stage: test
# script:
# - apt update
# - DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*i386.deb
# - openrgb --version
# - openrgb -l
# - apt remove -y openrgb
# dependencies:
# - "Linux 32 deb"
# needs:
# - "Linux 32 deb"
# #-----------------------------------------------------------------------#
# # Mint 32 19.3 test #
# #-----------------------------------------------------------------------#
# "Mint 32 20.1":
# image: linuxmintd/mint19.3-i386
# stage: test
# script:
# - apt update
# - DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*i386.deb
# - openrgb --version
# - openrgb -l
# - apt remove -y openrgb
# dependencies:
# - "Linux 32 deb"
# needs:
# - "Linux 32 deb"
#-----------------------------------------------------------------------#
# Debian 64 Buster test #
#-----------------------------------------------------------------------#
"Debian 64 Buster":
image: debian:buster
stage: test
script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
- openrgb --version
- openrgb -l
- apt remove -y openrgb
dependencies:
- "Linux 64 deb"
needs:
- "Linux 64 deb"
- "Linux 32 .deb (Debian Bullseye)"
#-----------------------------------------------------------------------#
# Debian 64 Bullseye test #
#-----------------------------------------------------------------------#
"Debian 64 Bullseye":
image: debian:bullseye
image: amd64/debian:bullseye
stage: test
script:
- apt update
@@ -278,9 +240,43 @@ before_script:
- openrgb -l
- apt remove -y openrgb
dependencies:
- "Linux 64 deb"
- "Linux 64 .deb (Debian Bullseye)"
needs:
- "Linux 64 deb"
- "Linux 64 .deb (Debian Bullseye)"
#-----------------------------------------------------------------------#
# Ubuntu 64 20.04LTS test #
#-----------------------------------------------------------------------#
"Ubuntu 64 20.04LTS":
image: ubuntu:focal
stage: test
script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
- openrgb --version
- openrgb -l
- apt remove -y openrgb
dependencies:
- "Linux 64 .deb (Debian Buster)"
needs:
- "Linux 64 .deb (Debian Buster)"
#-----------------------------------------------------------------------#
# Ubuntu 64 21.10 test #
#-----------------------------------------------------------------------#
"Ubuntu 64 21.10":
image: ubuntu:impish
stage: test
script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
- openrgb --version
- openrgb -l
- apt remove -y openrgb
dependencies:
- "Linux 64 .deb (Debian Bullseye)"
needs:
- "Linux 64 .deb (Debian Bullseye)"
#-----------------------------------------------------------------------#
# Fedora 64 v34 test #
@@ -298,57 +294,6 @@ before_script:
needs:
- "Linux 64 rpm"
# #-----------------------------------------------------------------------#
# # Ubuntu 64 18.04LTS test #
# #-----------------------------------------------------------------------#
# "Ubuntu 64 18.04LTS":
# image: ubuntu:bionic
# stage: test
# script:
# - apt update
# - DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
# - openrgb --version
# - openrgb -l
# - apt remove -y openrgb
# dependencies:
# - "Linux 64 deb"
# needs:
# - "Linux 64 deb"
#-----------------------------------------------------------------------#
# Ubuntu 64 20.04LTS test #
#-----------------------------------------------------------------------#
"Ubuntu 64 20.04LTS":
image: ubuntu:focal
stage: test
script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
- openrgb --version
- openrgb -l
- apt remove -y openrgb
dependencies:
- "Linux 64 deb"
needs:
- "Linux 64 deb"
#-----------------------------------------------------------------------#
# Mint 64 20.1 test #
#-----------------------------------------------------------------------#
"Mint 64 20.1":
image: linuxmintd/mint20.1-amd64
stage: test
script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
- openrgb --version
- openrgb -l
- apt remove -y openrgb
dependencies:
- "Linux 64 deb"
needs:
- "Linux 64 deb"
#-----------------------------------------------------------------------#
# Windows (32-bit) Build Target #
#-----------------------------------------------------------------------#
+9
View File
@@ -236,8 +236,11 @@ SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b34", TAG+="uacces
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b74", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b3c", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b75", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b5d", TAG+="uaccess", TAG+="Ironclaw"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b12", TAG+="uaccess", TAG+="M65"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b2e", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b5a", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b5c", TAG+="uaccess", TAG+="Nightsword"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b3e", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b2f", TAG+="uaccess"
@@ -542,6 +545,8 @@ SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="025a", TAG+="uacces
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="025b", TAG+="uaccess", TAG+="Blackwidow_V3_Pro-Bluetooth"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="025c", TAG+="uaccess", TAG+="Blackwidow_V3_Pro-Wireless"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0a24", TAG+="uaccess", TAG+="Blackwidow_V3_TKL"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0258", TAG+="uaccess", TAG+="Blackwidow_V3_Mini-Wired"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0271", TAG+="uaccess", TAG+="Blackwidow_V3_Mini-Wireless"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0216", TAG+="uaccess", TAG+="Blackwidow_X Chroma"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="021a", TAG+="uaccess", TAG+="Blackwidow_X_Chroma_TE"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="020f", TAG+="uaccess"
@@ -578,7 +583,10 @@ SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0226", TAG+="uacces
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0227", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0257", TAG+="uaccess", TAG+="Huntsman_Mini"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0243", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="026b", TAG+="uaccess", TAG+="Huntsman_V2_TKL"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="026c", TAG+="uaccess", TAG+="Huntsman_V2"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0207", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0266", TAG+="uaccess", TAG+="Huntsman V2 Analog"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="021e", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="025d", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0208", TAG+="uaccess"
@@ -640,6 +648,7 @@ SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0039", TAG+="uacces
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0048", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0032", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0034", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0091", TAG+="uaccess", TAG+="Viper_8kHz"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="008a", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0078", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="007a", TAG+="uaccess"
@@ -628,7 +628,7 @@ void RGBController_Polychrome::DeviceUpdateMode()
{
if(polychrome->GetASRockType() == ASROCK_TYPE_POLYCHROME_V1)
{
for(unsigned int led_idx = 0; led_idx <= leds.size(); led_idx++)
for(unsigned int led_idx = 0; led_idx < leds.size(); led_idx++)
{
polychrome->SetMode(led_idx, modes[active_mode].value, modes[active_mode].speed);
}
@@ -52,6 +52,9 @@ static const gpu_pci_device device_list[] =
{ NVIDIA_VEN, NVIDIA_GTX1660S_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1660S_O6G_GAMING, 0x2A, "ASUS ROG Strix GTX 1660S O6G Gaming" },
{ NVIDIA_VEN, NVIDIA_GTX1660TI_DEV, ASUS_SUB_VEN, ASUS_ROG_GTX1660TI_OC, 0x2A, "ASUS ROG GTX 1660 Ti OC 6G" },
{ NVIDIA_VEN, NVIDIA_RTX2060_TU106_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060_EVO_GAMING, 0x2A, "ASUS ROG STRIX RTX 2060 EVO Gaming 6G" },
{ NVIDIA_VEN, NVIDIA_RTX2060_TU106_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060_O6G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2060 O6G Gaming 6G" },
{ NVIDIA_VEN, NVIDIA_RTX2060_TU104_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060_O6G_EVO_GAMING, 0x2A, "ASUS ROG STRIX RTX 2060 O6G EVO Gaming" },
{ NVIDIA_VEN, NVIDIA_RTX2060S_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060S_8G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2060S 8G Gaming 8G" },
{ NVIDIA_VEN, NVIDIA_RTX2060S_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060S_A8G_EVO_GAMING, 0x2A, "ASUS ROG STRIX RTX 2060S A8G EVO Gaming 8G"},
{ NVIDIA_VEN, NVIDIA_RTX2060S_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060S_O8G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2060S O8G Gaming 8G" },
{ NVIDIA_VEN, NVIDIA_RTX2070_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2070_A8G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2070 A8G Gaming 8G" },
@@ -62,14 +65,17 @@ static const gpu_pci_device device_list[] =
{ NVIDIA_VEN, NVIDIA_RTX2070S_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2070S_O8G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2070S O8G Gaming 8G" },
{ NVIDIA_VEN, NVIDIA_RTX2080_A_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080_O8G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2080 O8G Gaming" },
{ NVIDIA_VEN, NVIDIA_RTX2080S_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080S_O8G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2080S O8G Gaming" },
{ NVIDIA_VEN, NVIDIA_RTX2080TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080TI_11G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2080 Ti 11G Gaming" },
{ NVIDIA_VEN, NVIDIA_RTX2080TI_A_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080TI_O11G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2080 Ti O11G Gaming" },
{ AMD_GPU_VEN, AMD_VEGA10_DEV, ASUS_SUB_VEN, ASUS_VEGA64_STRIX, 0x29, "ASUS Vega 64 Strix" },
{ AMD_GPU_VEN, AMD_NAVI10_DEV, ASUS_SUB_VEN, ASUS_RX5600XT_STRIX_O6G_GAMING, 0x2A, "ASUS RX 5600XT Strix O6G Gaming" },
{ AMD_GPU_VEN, AMD_NAVI10_DEV, ASUS_SUB_VEN, ASUS_RX5700XT_STRIX_GAMING_OC, 0x2A, "ASUS RX 5700XT Strix Gaming OC" },
{ AMD_GPU_VEN, AMD_POLARIS_DEV, ASUS_SUB_VEN, ASUS_RX480_STRIX_GAMING_OC, 0x29, "ASUS ROG STRIX RX480 Gaming OC" },
{ AMD_GPU_VEN, AMD_POLARIS11, ASUS_SUB_VEN, ASUS_RX560_STRIX_4G_GAMING, 0x29, "ASUS ROG STRIX RX560 Gaming" },
{ AMD_GPU_VEN, AMD_POLARIS_DEV, ASUS_SUB_VEN, ASUS_RX570_STRIX_O4G_GAMING_OC, 0x29, "ASUS RX 570 Strix O4G Gaming OC" },
{ AMD_GPU_VEN, AMD_POLARIS_DEV, ASUS_SUB_VEN, ASUS_RX580_STRIX_GAMING_OC, 0x29, "ASUS RX 580 Strix Gaming OC" },
{ AMD_GPU_VEN, AMD_POLARIS_DEV, ASUS_SUB_VEN, ASUS_RX580_STRIX_GAMING_TOP, 0x29, "ASUS RX 580 Strix Gaming TOP" },
{ NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_3060_TI_O8G_OC, 0x2A, "ASUS TUF RTX 3060 Ti 8G Gaming OC" },
};
/******************************************************************************************\
@@ -46,14 +46,14 @@ std::string AuraMouseController::GetSerialString()
std::string AuraMouseController::GetVersion(bool wireless, int protocol)
{
unsigned char usb_buf[65];
unsigned char usb_buf[ASUS_AURA_MOUSE_PACKET_SIZE];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x12;
hid_write(dev, usb_buf, 65);
hid_write(dev, usb_buf, ASUS_AURA_MOUSE_PACKET_SIZE);
unsigned char usb_buf_out[65];
hid_read(dev, usb_buf_out, 65);
unsigned char usb_buf_out[ASUS_AURA_MOUSE_PACKET_SIZE];
hid_read(dev, usb_buf_out, ASUS_AURA_MOUSE_PACKET_SIZE);
std::string str;
@@ -107,6 +107,14 @@ void AuraMouseController::SendUpdate
unsigned char brightness
)
{
int bytes_read = 1;
unsigned char usb_buf_flush[ASUS_AURA_MOUSE_PACKET_SIZE];
while(bytes_read > 0)
{
bytes_read = hid_read_timeout(dev, usb_buf_flush, ASUS_AURA_MOUSE_PACKET_SIZE, 0);
}
unsigned char usb_buf[ASUS_AURA_MOUSE_PACKET_SIZE];
/*-----------------------------------------------------*\
@@ -127,6 +135,7 @@ void AuraMouseController::SendUpdate
usb_buf[0x07] = red;
usb_buf[0x08] = grn;
usb_buf[0x09] = blu;
if (device_pid == AURA_ROG_GLADIUS_II_ORIGIN_PNK_LTD_PID)
{
usb_buf[0x0A] = 0;
@@ -147,4 +156,7 @@ void AuraMouseController::SendUpdate
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, usb_buf, ASUS_AURA_MOUSE_PACKET_SIZE);
unsigned char usb_buf_out[ASUS_AURA_MOUSE_PACKET_SIZE];
hid_read(dev, usb_buf_out, ASUS_AURA_MOUSE_PACKET_SIZE);
}
@@ -20,7 +20,7 @@
#define AURA_ROG_GLADIUS_II_WIRELESS_2_PID 0x18A0
#define AURA_ROG_CHAKRAM_WIRELESS_PID 0x18E5
#define AURA_ROG_CHAKRAM_WIRED_1_PID 0x18E3
#define AURA_ROG_CHAKRAM_WIRED_2_PID 0x1958
#define AURA_ROG_CHAKRAM_CORE_PID 0x1958
#define AURA_ROG_PUGIO_PID 0x1846
#define AURA_ROG_PUGIO_II_WIRED_PID 0x1906
#define AURA_ROG_PUGIO_II_WIRELESS_PID 0x1908
@@ -168,14 +168,14 @@ static std::map<int,mouse_type> aura_mouse_devices =
}
},
{
AURA_ROG_CHAKRAM_WIRED_2_PID, // ROG Chakram Wired 2
AURA_ROG_CHAKRAM_CORE_PID, // ROG Chakram Core
{
15,
1,
0,
0,
false,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_WAVE, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_COMET, AURA_MOUSE_MODE_BATTERY }
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_REACTIVE }
}
},
{
@@ -0,0 +1,130 @@
/*-----------------------------------------*\
| AsusAuraMousematController.cpp |
| |
| Driver for ASUS Aura RGB USB |
| lighting controller |
| |
| Adam Honse (CalcProgrammer1) 1/10/2022 |
\*-----------------------------------------*/
#include "AsusAuraMousematController.h"
#include <cstring>
AuraMousematController::AuraMousematController(hid_device* dev_handle, const char* path)
{
dev = dev_handle;
location = path;
}
AuraMousematController::~AuraMousematController()
{
hid_close(dev);
}
std::string AuraMousematController::GetDeviceLocation()
{
return("HID: " + location);
}
std::string AuraMousematController::GetSerialString()
{
wchar_t serial_string[128];
int ret = hid_get_serial_number_string(dev, serial_string, 128);
if(ret != 0)
{
return("");
}
std::wstring return_wstring = serial_string;
std::string return_string(return_wstring.begin(), return_wstring.end());
return(return_string);
}
std::string AuraMousematController::GetVersion()
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0xEE;
usb_buf[0x01] = 0x12;
usb_buf[0x02] = 0x00;
hid_write(dev, usb_buf, 65);
unsigned char usb_buf_out[65];
hid_read(dev, usb_buf_out, 65);
char version[5];
snprintf(version, 5, "%04X", (usb_buf_out[6] << 8) | usb_buf_out[7]);
return std::string(version);
}
void AuraMousematController::UpdateLeds
(
std::vector<RGBColor> colors
)
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0xEE;
usb_buf[0x01] = 0xC0;
usb_buf[0x02] = 0x81;
usb_buf[0x03] = 0x00;
usb_buf[0x04] = 0x00;
for(unsigned int i = 0; i < 60; i += 4)
{
usb_buf[5 + i] = 0x00;
usb_buf[6 + i] = RGBGetRValue(colors[i / 4]);
usb_buf[7 + i] = RGBGetGValue(colors[i / 4]);
usb_buf[8 + i] = RGBGetBValue(colors[i / 4]);
}
hid_write(dev, usb_buf, 65);
}
void AuraMousematController::UpdateDevice
(
unsigned char mode,
unsigned char red,
unsigned char grn,
unsigned char blu,
unsigned char speed,
unsigned char brightness
)
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0xEE;
usb_buf[0x01] = 0x51;
usb_buf[0x02] = 0x28;
usb_buf[0x03] = 0x00;
usb_buf[0x04] = 0x00;
usb_buf[0x05] = mode;
usb_buf[0x06] = speed;
usb_buf[0x07] = brightness;
usb_buf[0x08] = 0x00;
usb_buf[0x09] = 0x00;
usb_buf[0x0a] = red;
usb_buf[0x0b] = grn;
usb_buf[0x0c] = blu;
hid_write(dev, usb_buf, 65);
}
void AuraMousematController::SaveMode()
{
unsigned char usb_save_buf[65];
memset(usb_save_buf, 0x00, sizeof(usb_save_buf));
usb_save_buf[0x00] = 0xEE;
usb_save_buf[0x01] = 0x50;
usb_save_buf[0x02] = 0x55;
hid_write(dev, usb_save_buf, 65);
}
@@ -0,0 +1,53 @@
/*-----------------------------------------*\
| AsusAuraMousematController.h |
| |
| Definitions and types for ASUS Aura |
| USB RGB lighting controller |
| |
| Adam Honse (CalcProgrammer1) 1/10/2022 |
\*-----------------------------------------*/
#include "RGBController.h"
#include <hidapi/hidapi.h>
#pragma once
enum
{
AURA_MOUSEMAT_MODE_DIRECT = 0,
AURA_MOUSEMAT_MODE_BREATHING = 1,
AURA_MOUSEMAT_MODE_CHASING = 3,
};
class AuraMousematController
{
public:
AuraMousematController(hid_device* dev_handle, const char* path);
virtual ~AuraMousematController();
std::string GetDeviceLocation();
std::string GetSerialString();
std::string GetVersion();
void UpdateLeds
(
std::vector<RGBColor> colors
);
void UpdateDevice
(
unsigned char mode,
unsigned char red,
unsigned char grn,
unsigned char blu,
unsigned char speed,
unsigned char brightness
);
void SaveMode();
private:
hid_device* dev;
std::string location;
};
@@ -5,6 +5,7 @@
#include "AsusAuraTUFKeyboardController.h"
#include "AsusAuraMainboardController.h"
#include "AsusAuraMouseController.h"
#include "AsusAuraMousematController.h"
#include "AsusAuraStrixEvolveController.h"
#include "RGBController.h"
#include "RGBController_AsusAuraUSB.h"
@@ -12,6 +13,7 @@
#include "RGBController_AsusAuraKeyboard.h"
#include "RGBController_AsusAuraTUFKeyboard.h"
#include "RGBController_AsusAuraMouse.h"
#include "RGBController_AsusAuraMousemat.h"
#include "RGBController_AsusAuraStrixEvolve.h"
#include <stdexcept>
#include <hidapi/hidapi.h>
@@ -48,6 +50,12 @@
#define AURA_ROG_STRIX_EVOLVE_PID 0x185B
/*-----------------------------------------------------------------*\
| MOUSEMATS |
\*-----------------------------------------------------------------*/
#define AURA_ROG_BALTEUS_PID 0x1891
#define AURA_ROG_BALTEUS_QI_PID 0x1890
/*-----------------------------------------------------------------*\
| OTHER |
\*-----------------------------------------------------------------*/
@@ -154,6 +162,18 @@ void DetectAsusAuraUSBMice(hid_device_info* info, const std::string& name)
}
}
void DetectAsusAuraUSBMousemats(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
AuraMousematController* controller = new AuraMousematController(dev, info->path);
RGBController_AuraMousemat* rgb_controller = new RGBController_AuraMousemat(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
void DetectAsusAuraUSBStrixEvolve(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
@@ -225,7 +245,7 @@ REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Wireless", DetectAsusAuraUS
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Wireless", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_WIRELESS_2_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Chakram (Wireless)", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_CHAKRAM_WIRELESS_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("Asus ROG Chakram (Wired)", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_CHAKRAM_WIRED_1_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("Asus ROG Chakram (Wired)", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_CHAKRAM_WIRED_2_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("Asus ROG Chakram Core", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_CHAKRAM_CORE_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Pugio", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_PUGIO_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Pugio II (Wired)", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_PUGIO_II_WIRED_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Pugio II (Wireless)", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_PUGIO_II_WIRELESS_PID, 0, 0xFF01);
@@ -235,6 +255,12 @@ REGISTER_HID_DETECTOR_IP("ASUS TUF Gaming M5", DetectAsusAuraUS
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Evolve", DetectAsusAuraUSBStrixEvolve, AURA_USB_VID, AURA_ROG_STRIX_EVOLVE_PID, 1, 0x0008);
/*-----------------------------------------------------------------*\
| MOUSEMATS |
\*-----------------------------------------------------------------*/
REGISTER_HID_DETECTOR ("ASUS ROG Balteus", DetectAsusAuraUSBMousemats, AURA_USB_VID, AURA_ROG_BALTEUS_PID );
REGISTER_HID_DETECTOR ("ASUS ROG Balteus Qi", DetectAsusAuraUSBMousemats, AURA_USB_VID, AURA_ROG_BALTEUS_QI_PID );
/*-----------------------------------------------------------------*\
| OTHER |
\*-----------------------------------------------------------------*/
@@ -191,9 +191,9 @@ void RGBController_AuraMouse::ResizeZone(int /*zone*/, int /*new_size*/)
void RGBController_AuraMouse::DeviceUpdateLEDs()
{
for(std::vector<led>::iterator led_it = leds.begin(); led_it != leds.end(); led_it++)
for(unsigned int zone_index = 0; zone_index < zones.size(); zone_index++)
{
UpdateSingleLED(led_it->value);
UpdateSingleLED(zone_index);
}
}
@@ -0,0 +1,147 @@
/*-----------------------------------------*\
| RGBController_AsusAuraMousemat.cpp |
| |
| Generic RGB Interface for Asus Aura |
| USB controller driver |
| |
| Adam Honse (CalcProgrammer1) 1/10/2022 |
\*-----------------------------------------*/
#include "RGBController_AsusAuraMousemat.h"
RGBController_AuraMousemat::RGBController_AuraMousemat(AuraMousematController* controller_ptr)
{
controller = controller_ptr;
name = "ASUS Aura Mousemat";
vendor = "ASUS";
type = DEVICE_TYPE_MOUSEMAT;
description = "ASUS Aura Mousemat Device";
version = controller->GetVersion();
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
Direct.value = AURA_MOUSEMAT_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
// mode Breathing;
// Breathing.name = "Breathing";
// Breathing.value = AURA_MOUSEMAT_MODE_BREATHING;
// Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
// Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
// Breathing.speed_min = AURA_MOUSEMAT_SPEED_MIN;
// Breathing.speed_max = AURA_MOUSEMAT_SPEED_MAX;
// Breathing.speed = AURA_MOUSEMAT_SPEED_DEFAULT;
// Breathing.brightness_min = AURA_MOUSEMAT_BRIGHTNESS_MIN;
// Breathing.brightness_max = AURA_MOUSEMAT_BRIGHTNESS_MAX;
// Breathing.brightness = AURA_MOUSEMAT_BRIGHTNESS_DEFAULT;
// Breathing.colors_min = 1;
// Breathing.colors_max = 1;
// Breathing.colors.resize(1);
// modes.push_back(Breathing);
// mode Chasing;
// Chasing.name = "Chasing";
// Chasing.value = AURA_MOUSEMAT_MODE_CHASING;
// Chasing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
// Chasing.color_mode = MODE_COLORS_MODE_SPECIFIC;
// Chasing.speed_min = AURA_MOUSEMAT_SPEED_MIN;
// Chasing.speed_max = AURA_MOUSEMAT_SPEED_MAX;
// Chasing.speed = AURA_MOUSEMAT_SPEED_DEFAULT;
// Chasing.brightness_min = AURA_MOUSEMAT_BRIGHTNESS_MIN;
// Chasing.brightness_max = AURA_MOUSEMAT_BRIGHTNESS_MAX;
// Chasing.brightness = AURA_MOUSEMAT_BRIGHTNESS_DEFAULT;
// Chasing.colors_min = 1;
// Chasing.colors_max = 1;
// Chasing.colors.resize(1);
// modes.push_back(Chasing);
SetupZones();
}
RGBController_AuraMousemat::~RGBController_AuraMousemat()
{
delete controller;
}
void RGBController_AuraMousemat::SetupZones()
{
zone mousemat_zone;
mousemat_zone.name = "Mousemat";
mousemat_zone.type = ZONE_TYPE_LINEAR;
mousemat_zone.leds_min = 15;
mousemat_zone.leds_max = 15;
mousemat_zone.leds_count = 15;
mousemat_zone.matrix_map = NULL;
zones.push_back(mousemat_zone);
for(unsigned int i = 0; i < 15; i++)
{
led mousemat_led;
mousemat_led.name = "Mousemat LED " + std::to_string(i);
leds.push_back(mousemat_led);
}
SetupColors();
}
void RGBController_AuraMousemat::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_AuraMousemat::DeviceUpdateLEDs()
{
controller->UpdateLeds(std::vector<RGBColor>(colors));
}
void RGBController_AuraMousemat::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_AuraMousemat::UpdateSingleLED(int /*led*/)
{
DeviceUpdateLEDs();
}
void RGBController_AuraMousemat::SetCustomMode()
{
active_mode = 0;
}
void RGBController_AuraMousemat::DeviceUpdateMode()
{
unsigned char red = 0;
unsigned char grn = 0;
unsigned char blu = 0;
switch(modes[active_mode].value)
{
case AURA_MOUSEMAT_MODE_DIRECT:
controller->UpdateLeds(std::vector<RGBColor>(colors));
break;
case AURA_MOUSEMAT_MODE_BREATHING:
case AURA_MOUSEMAT_MODE_CHASING:
red = RGBGetRValue(modes[active_mode].colors[0]);
grn = RGBGetGValue(modes[active_mode].colors[0]);
blu = RGBGetBValue(modes[active_mode].colors[0]);
controller->UpdateDevice(modes[active_mode].value, red, grn, blu, modes[active_mode].speed, modes[active_mode].brightness);
break;
}
}
void RGBController_AuraMousemat::DeviceSaveMode()
{
DeviceUpdateMode();
controller->SaveMode();
}
@@ -0,0 +1,44 @@
/*-----------------------------------------*\
| RGBController_AsusAuraMousemat.h |
| |
| Generic RGB Interface for Asus Aura |
| USB controller driver |
| |
| Mola19 06/04/2021 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "AsusAuraMousematController.h"
enum
{
AURA_MOUSEMAT_BRIGHTNESS_MIN = 0,
AURA_MOUSEMAT_BRIGHTNESS_MAX = 4,
AURA_MOUSEMAT_BRIGHTNESS_DEFAULT = 4,
AURA_MOUSEMAT_SPEED_MIN = 0,
AURA_MOUSEMAT_SPEED_MAX = 255,
AURA_MOUSEMAT_SPEED_DEFAULT = 127,
};
class RGBController_AuraMousemat : public RGBController
{
public:
RGBController_AuraMousemat(AuraMousematController* controller_ptr);
~RGBController_AuraMousemat();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
void DeviceSaveMode();
private:
AuraMousematController* controller;
};
@@ -265,7 +265,7 @@ void CorsairLightingNodeController::SendDirect
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, usb_buf, 65);
hid_read_timeout(dev, usb_buf, 17, 1);
hid_read_timeout(dev, usb_buf, 17, 5);
}
void CorsairLightingNodeController::SendCommit()
@@ -293,7 +293,7 @@ void CorsairLightingNodeController::SendCommit()
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, usb_buf, 65);
hid_read_timeout(dev, usb_buf, 17, 1);
hid_read_timeout(dev, usb_buf, 17, 5);
}
void CorsairLightingNodeController::SendBegin
@@ -456,7 +456,7 @@ void CorsairLightingNodeController::SendPortState
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, usb_buf, 65);
hid_read_timeout(dev, usb_buf, 17, 1);
hid_read_timeout(dev, usb_buf, 17, 5);
}
void CorsairLightingNodeController::SendBrightness
@@ -0,0 +1,106 @@
#include "CorsairK55RGBPROController.h"
/*-----------------------------------------*\
| CorsairK55RGBPROController.cpp |
| |
| Driver for Corsair K55 RGB PRO Keyboard |
\*-----------------------------------------*/
#include "LogManager.h"
CorsairK55RGBPROController::CorsairK55RGBPROController(hid_device* dev_handle, const char* path)
{
dev = dev_handle;
location = path;
LightingControl();
}
CorsairK55RGBPROController::~CorsairK55RGBPROController()
{
hid_close(dev);
}
std::string CorsairK55RGBPROController::GetDeviceLocation()
{
return("HID: " + location);
}
std::string CorsairK55RGBPROController::GetFirmwareString()
{
return "";
}
std::string CorsairK55RGBPROController::GetName()
{
return name;
}
void CorsairK55RGBPROController::SetName(std::string device_name)
{
name = device_name;
}
std::string CorsairK55RGBPROController::GetSerialString()
{
wchar_t serial_string[128];
int ret = hid_get_serial_number_string(dev, serial_string, 128);
if(ret != 0)
{
return("");
}
std::wstring return_wstring = serial_string;
std::string return_string(return_wstring.begin(), return_wstring.end());
return(return_string);
}
void CorsairK55RGBPROController::LightingControl()
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
//This is requered
usb_buf[0x01] = 0x08;
usb_buf[0x02] = 0x01;
usb_buf[0x03] = 0x03;
usb_buf[0x05] = 0x02;
hid_write(dev, (unsigned char *)usb_buf, 65);
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x01] = 0x08;
usb_buf[0x02] = 0x02;
usb_buf[0x03] = 0x5F;
hid_write(dev, (unsigned char *)usb_buf, 65);
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x01] = 0x08;
usb_buf[0x02] = 0x0D;
usb_buf[0x04] = 0x01;
hid_write(dev, (unsigned char *)usb_buf, 65);
}
void CorsairK55RGBPROController::SetLEDs(std::vector<RGBColor>colors)
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x01] = 0x08;
usb_buf[0x02] = 0x06;
usb_buf[0x04] = 0x12;
for(std::size_t color_idx = 0; color_idx < colors.size(); color_idx++)
{
RGBColor color = colors[color_idx];
usb_buf[9 + color_idx] = RGBGetRValue(color);
usb_buf[15 + color_idx] = RGBGetGValue(color);
usb_buf[21 + color_idx] = RGBGetBValue(color);
}
hid_write(dev, (unsigned char *)usb_buf, 65);
}
@@ -0,0 +1,35 @@
#ifndef CORSAIRK55RGBPROCONTROLLER_H
#define CORSAIRK55RGBPROCONTROLLER_H
#include "RGBController.h"
#include <string>
#include <hidapi/hidapi.h>
class CorsairK55RGBPROController
{
public:
CorsairK55RGBPROController(hid_device* dev_handle, const char* path);
~CorsairK55RGBPROController();
std::string GetDeviceLocation();
std::string GetFirmwareString();
std::string GetName();
std::string GetSerialString();
void SetLEDs(std::vector<RGBColor> colors);
void SetLEDsKeyboardLimited(std::vector<RGBColor> colors);
void SetName(std::string device_name);
private:
hid_device* dev;
std::string firmware_version;
std::string location;
std::string name;
device_type type;
void LightingControl();
void SetLEDsKeyboardFull(std::vector<RGBColor> colors);
};
#endif // CORSAIRK55RGBPROCONTROLLER_H
@@ -60,6 +60,7 @@ static unsigned int st100[] = { 0x00, 0x01, 0x02, 0x03, 0x05, 0x06, 0x07, 0x08,
static unsigned int key_mapping_k95_plat_ansi[] = { 0x31, 0x3f, 0x41, 0x42, 0x51, 0x53, 0x55, 0x6f, 0x7e, 0x7f, 0x80, 0x81 };
static unsigned int key_mapping_k95_plat_iso[] = { 0x3f, 0x41, 0x42, 0x48, 0x50, 0x53, 0x55, 0x6f, 0x7e, 0x7f, 0x80, 0x81 };
static unsigned int key_mapping_k70_mk2_plat_iso[] = { 0x3f, 0x41, 0x42, 0x50, 0x53, 0x55, 0x6f, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81 };
#define CORSAIR_PERIPHERAL_CONTROLLER_NAME "Corsair peripheral"
@@ -421,8 +422,16 @@ void CorsairPeripheralController::SetupK55AndK95LightingControl()
if (physical_layout == CORSAIR_LAYOUT_ISO)
{
skipped_identifiers = key_mapping_k95_plat_iso;
skipped_identifiers_count = sizeof(key_mapping_k95_plat_iso) / sizeof(key_mapping_k95_plat_iso[0]);
if(logical_layout == CORSAIR_TYPE_K70_MK2)
{
skipped_identifiers = key_mapping_k70_mk2_plat_iso;
skipped_identifiers_count = sizeof(key_mapping_k70_mk2_plat_iso) / sizeof(key_mapping_k70_mk2_plat_iso[0]);
}
else
{
skipped_identifiers = key_mapping_k95_plat_iso;
skipped_identifiers_count = sizeof(key_mapping_k95_plat_iso) / sizeof(key_mapping_k95_plat_iso[0]);
}
}
unsigned int identifier = 0;
@@ -1,10 +1,12 @@
#include "Detector.h"
#include "CorsairPeripheralController.h"
#include "CorsairK100Controller.h"
#include "CorsairK55RGBPROController.h"
#include "LogManager.h"
#include "RGBController.h"
#include "RGBController_CorsairPeripheral.h"
#include "RGBController_CorsairK100.h"
#include "RGBController_CorsairK55RGBPRO.h"
#include <hidapi/hidapi.h>
#define CORSAIR_PERIPHERAL_CONTROLLER_NAME "Corsair peripheral"
@@ -50,8 +52,10 @@
#define CORSAIR_HARPOON_RGB_PID 0x1B3C
#define CORSAIR_HARPOON_RGB_PRO_PID 0x1B75
#define CORSAIR_IRONCLAW_RGB_PID 0x1B5D
#define CORSAIR_M65_PID 0x1B12
#define CORSAIR_M65_PRO_PID 0x1B2E
#define CORSAIR_M65_RGB_ELITE_PID 0x1B5A
#define CORSAIR_NIGHTSWORD_PID 0x1B5C
#define CORSAIR_SCIMITAR_PRO_RGB_PID 0x1B3E
#define CORSAIR_SABRE_RGB_PID 0x1B2F
@@ -94,6 +98,25 @@ void DetectCorsairK100Controllers(hid_device_info* info, const std::string& name
}
} /* DetectCorsairPeripheralControllers() */
/*-----------------------------------------------------*\
| Corsair K55 RGB PRO Keyboard product ID |
| This keyboard uses a separate driver |
\*-----------------------------------------------------*/
#define CORSAIR_K55_RGB_PRO_PID 0x1BA4
void DetectCorsairK55RGBPROControllers(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
CorsairK55RGBPROController* controller = new CorsairK55RGBPROController(dev, info->path);
controller->SetName(name);
RGBController_CorsairK55RGBPRO* rgb_controller = new RGBController_CorsairK55RGBPRO(controller);
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
} /* DetectCorsairK55RGBPROControllers() */
/******************************************************************************************\
* *
* DetectCorsairPeripheralControllers *
@@ -128,34 +151,36 @@ void DetectCorsairPeripheralControllers(hid_device_info* info, const std::string
/*-----------------------------------------------------------------------------------------------------*\
| Keyboards |
\*-----------------------------------------------------------------------------------------------------*/
REGISTER_HID_DETECTOR_IP("Corsair K55 RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K55_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K65 RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K65_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K65 LUX RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K65_LUX_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K65 RGB RAPIDFIRE", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K65_RGB_RAPIDFIRE_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K68 RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K68_RGB, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K70 RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K70_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K70 LUX RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K70_LUX_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K70 RGB RAPIDFIRE", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K70_RGB_RAPIDFIRE_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K70 RGB MK.2", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K70_RGB_MK2_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K70 RGB MK.2 SE", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K70_RGB_MK2_SE_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K70 RGB MK.2 Low Profile", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K70_RGB_MK2_LP_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K95 RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K95_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K95 RGB PLATINUM", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K95_PLATINUM_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Strafe", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_STRAFE_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Strafe Red", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_STRAFE_RED_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Strafe MK.2", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_STRAFE_MK2_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K55 RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K55_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K65 RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K65_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K65 LUX RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K65_LUX_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K65 RGB RAPIDFIRE", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K65_RGB_RAPIDFIRE_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K68 RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K68_RGB, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K70 RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K70_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K70 LUX RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K70_LUX_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K70 RGB RAPIDFIRE", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K70_RGB_RAPIDFIRE_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K70 RGB MK.2", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K70_RGB_MK2_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K70 RGB MK.2 SE", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K70_RGB_MK2_SE_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K70 RGB MK.2 Low Profile",DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K70_RGB_MK2_LP_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K95 RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K95_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair K95 RGB PLATINUM", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_K95_PLATINUM_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Strafe", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_STRAFE_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Strafe Red", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_STRAFE_RED_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Strafe MK.2", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_STRAFE_MK2_PID, 1, 0xFFC2);
/*-----------------------------------------------------------------------------------------------------*\
| Mice |
\*-----------------------------------------------------------------------------------------------------*/
REGISTER_HID_DETECTOR_IP("Corsair Glaive RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_GLAIVE_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Glaive RGB PRO", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_GLAIVE_RGB_PRO_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Harpoon RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_HARPOON_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Harpoon RGB PRO", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_HARPOON_RGB_PRO_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Ironclaw RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_IRONCLAW_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair M65 PRO", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_M65_PRO_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair M65 RGB Elite" , DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_M65_RGB_ELITE_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Scimitar PRO RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_SCIMITAR_PRO_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Sabre RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_SABRE_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Glaive RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_GLAIVE_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Glaive RGB PRO", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_GLAIVE_RGB_PRO_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Harpoon RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_HARPOON_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Harpoon RGB PRO", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_HARPOON_RGB_PRO_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Ironclaw RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_IRONCLAW_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair M65", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_M65_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair M65 PRO", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_M65_PRO_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair M65 RGB Elite", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_M65_RGB_ELITE_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Nightsword", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_NIGHTSWORD_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Scimitar PRO RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_SCIMITAR_PRO_RGB_PID, 1, 0xFFC2);
REGISTER_HID_DETECTOR_IP("Corsair Sabre RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_SABRE_RGB_PID, 1, 0xFFC2);
/*-----------------------------------------------------------------------------------------------------*\
| Mousemats |
@@ -178,3 +203,8 @@ REGISTER_HID_DETECTOR_I("Corsair ST100 RGB", DetectCorsairPeriphe
| Corsair K100 Keyboard |
\*-----------------------------------------------------------------------------------------------------*/
REGISTER_HID_DETECTOR_IP("Corsair K100", DetectCorsairK100Controllers, CORSAIR_VID, CORSAIR_K100_PID, 1, 0xFF42);
/*-----------------------------------------------------------------------------------------------------*\
| Corsair K55 RGB PRO Keyboard |
\*-----------------------------------------------------------------------------------------------------*/
REGISTER_HID_DETECTOR_IP("Corsair K55 RGB PRO", DetectCorsairK55RGBPROControllers, CORSAIR_VID, CORSAIR_K55_RGB_PRO_PID, 1, 0xFF42);
@@ -0,0 +1,135 @@
#include "RGBController_CorsairK55RGBPRO.h"
/*-----------------------------------------*\
| RGBController_CorsairK55RGBPRO.cpp |
| |
| Driver for Corsair K55 RGB PRO0 Keyboard |
\*-----------------------------------------*/
#include "LogManager.h"
using namespace std::chrono_literals;
RGBController_CorsairK55RGBPRO::RGBController_CorsairK55RGBPRO(CorsairK55RGBPROController* corsair_ptr)
{
corsair = corsair_ptr;
name = corsair->GetName();
vendor = "Corsair";
description = "Corsair K55 RGB PRO Keyboard Device";
type = DEVICE_TYPE_KEYBOARD;
version = corsair->GetFirmwareString();
location = corsair->GetDeviceLocation();
serial = corsair->GetSerialString();
mode Direct;
Direct.name = "Direct";
Direct.value = 0;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
SetupZones();
/*-----------------------------------------------------*\
| The Corsair K55 RGB PRO requires a packet within |
| 1 minutes of sending the lighting change in order |
| to not revert back into rainbow mode. Start a thread |
| to continuously send a keepalive packet every 50 sec |
\*-----------------------------------------------------*/
keepalive_thread_run = true;
keepalive_thread = new std::thread(&RGBController_CorsairK55RGBPRO::KeepaliveThread, this);
}
RGBController_CorsairK55RGBPRO::~RGBController_CorsairK55RGBPRO()
{
/*-----------------------------------------------------*\
| Close keepalive thread |
\*-----------------------------------------------------*/
keepalive_thread_run = false;
keepalive_thread->join();
delete keepalive_thread;
/*---------------------------------------------------------*\
| Delete the matrix map |
\*---------------------------------------------------------*/
for(unsigned int zone_index = 0; zone_index < zones.size(); zone_index++)
{
if(zones[zone_index].type == ZONE_TYPE_MATRIX)
{
delete zones[zone_index].matrix_map;
}
}
delete corsair;
}
void RGBController_CorsairK55RGBPRO::SetupZones()
{
zone new_zone;
new_zone.name = "Keyboard";
new_zone.type = ZONE_TYPE_LINEAR;
new_zone.leds_min = 5;
new_zone.leds_max = 5;
new_zone.leds_count = 5;
new_zone.matrix_map = NULL;
for(unsigned int led_idx = 0; led_idx < new_zone.leds_count; led_idx++)
{
led new_led;
new_led.name = "Zone " + std::to_string( led_idx );
leds.push_back(new_led);
}
zones.push_back(new_zone);
SetupColors();
}
void RGBController_CorsairK55RGBPRO::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_CorsairK55RGBPRO::DeviceUpdateLEDs()
{
last_update_time = std::chrono::steady_clock::now();
corsair->SetLEDs(colors);
}
void RGBController_CorsairK55RGBPRO::UpdateZoneLEDs(int /*zone*/)
{
corsair->SetLEDs(colors);
}
void RGBController_CorsairK55RGBPRO::UpdateSingleLED(int /*led*/)
{
corsair->SetLEDs(colors);
}
void RGBController_CorsairK55RGBPRO::SetCustomMode()
{
active_mode = 0;
}
void RGBController_CorsairK55RGBPRO::DeviceUpdateMode()
{
}
void RGBController_CorsairK55RGBPRO::KeepaliveThread()
{
while(keepalive_thread_run.load())
{
if(active_mode == 0)
{
if((std::chrono::steady_clock::now() - last_update_time) > std::chrono::milliseconds(50000))
{
DeviceUpdateLEDs();
}
}
std::this_thread::sleep_for(3000ms);
}
}
@@ -0,0 +1,33 @@
#ifndef RGBCONTROLLER_CORSAIRK55RGBPRO_H
#define RGBCONTROLLER_CORSAIRK55RGBPRO_H
#include "RGBController.h"
#include "CorsairK55RGBPROController.h"
class RGBController_CorsairK55RGBPRO : public RGBController
{
public:
RGBController_CorsairK55RGBPRO(CorsairK55RGBPROController* corsair_ptr);
~RGBController_CorsairK55RGBPRO();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
void SetCustomMode();
void KeepaliveThread();
private:
CorsairK55RGBPROController* corsair;
std::thread* keepalive_thread;
std::atomic<bool> keepalive_thread_run;
std::chrono::time_point<std::chrono::steady_clock> last_update_time;
};
#endif // RGBCONTROLLER_CORSAIRK55RGBPRO_H
@@ -16,6 +16,7 @@
typedef unsigned char corsair_dev_id;
#define CORSAIR_PRO_LED_COUNT ( 10 )
#define CORSAIR_VENGEANCE_RGB_PRO_NAME "Corsair Vengenance RGB PRO"
enum
{
@@ -4,6 +4,7 @@
#include "RGBController_CorsairVengeancePro.h"
#include "i2c_smbus.h"
#include "pci_ids.h"
#include "LogManager.h"
#include <vector>
#include <stdio.h>
#include <stdlib.h>
@@ -24,6 +25,8 @@ bool TestForCorsairVengeanceProController(i2c_smbus_interface* bus, unsigned cha
int res = bus->i2c_smbus_write_quick(address, I2C_SMBUS_WRITE);
LOG_DEBUG("[%s] Trying address %02X", CORSAIR_VENGEANCE_RGB_PRO_NAME, address);
if (res >= 0)
{
pass = true;
@@ -33,6 +36,7 @@ bool TestForCorsairVengeanceProController(i2c_smbus_interface* bus, unsigned cha
if (res != 0x1C)
{
pass = false;
LOG_DEBUG("[%s] Failed: was expecting 0x1C got %02X", CORSAIR_VENGEANCE_RGB_PRO_NAME, res);
}
res = bus->i2c_smbus_read_byte_data(address, 0x44);
@@ -40,8 +44,13 @@ bool TestForCorsairVengeanceProController(i2c_smbus_interface* bus, unsigned cha
if (!((res == 0x03) || (res == 0x04)))
{
pass = false;
LOG_DEBUG("[%s] Failed: was expecting 0x03 or 0x04 got %02X", CORSAIR_VENGEANCE_RGB_PRO_NAME, res);
}
}
else
{
LOG_DEBUG("[%s] Failed: res was %04X", CORSAIR_VENGEANCE_RGB_PRO_NAME, res);
}
std::this_thread::sleep_for(10ms);
@@ -67,6 +76,8 @@ void DetectCorsairVengeanceProControllers(std::vector<i2c_smbus_interface*> &bus
for (unsigned int bus = 0; bus < busses.size(); bus++)
{
LOG_DEBUG("[%s] Testing bus %d", CORSAIR_VENGEANCE_RGB_PRO_NAME, bus);
IF_DRAM_SMBUS(busses[bus]->pci_vendor, busses[bus]->pci_device)
{
// Check for Corsair controller at 0x58
@@ -133,6 +144,10 @@ void DetectCorsairVengeanceProControllers(std::vector<i2c_smbus_interface*> &bus
ResourceManager::get()->RegisterRGBController(new_controller);
}
}
else
{
LOG_DEBUG("[%s] Check failed for VID:PID %04X:%04X", CORSAIR_VENGEANCE_RGB_PRO_NAME, busses[bus]->pci_vendor, busses[bus]->pci_device);
}
}
} /* DetectCorsairVengeanceProControllers() */
@@ -163,6 +163,11 @@ void RGBController_Crucial::DeviceUpdateLEDs()
else
{
crucial->SetAllColorsEffect(&colors[0]);
if(modes[active_mode].value == CRUCIAL_MODE_STATIC)
{
crucial->SetMode(modes[active_mode].value);
}
}
}
@@ -96,11 +96,13 @@ static const gpu_pci_device device_list[] =
{ NVIDIA_VEN, NVIDIA_RTX3070TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3070TI_O8G_GAMING, 0x67, "ASUS ROG STRIX 3070Ti O8G GAMING" },
{ NVIDIA_VEN, NVIDIA_RTX3080_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3080_O10G_GAMING, 0x67, "ASUS ROG STRIX 3080 O10G GAMING" },
{ NVIDIA_VEN, NVIDIA_RTX3080_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3080_O10G_WHITE, 0x67, "ASUS ROG STRIX 3080 O10G WHITE" },
{ NVIDIA_VEN, NVIDIA_RTX3080_LHR_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3080_O10G_V2_WHITE, 0x67, "ASUS ROG STRIX 3080 O10G V2 WHITE" },
{ NVIDIA_VEN, NVIDIA_RTX3080_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_3080_10G_GAMING_PD, 0x67, "ASUS TUF RTX 3080 10G GAMING" },
{ NVIDIA_VEN, NVIDIA_RTX3080_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_3080_O10G_OC, 0x67, "ASUS TUF RTX 3080 O10G OC" },
{ NVIDIA_VEN, NVIDIA_RTX3080_LHR_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_3080_O10G_V2_GAMING_8822, 0x67, "ASUS TUF RTX 3080 O10G V2 GAMING" },
{ NVIDIA_VEN, NVIDIA_RTX3080_LHR_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_3080_O10G_V2_GAMING, 0x67, "ASUS TUF RTX 3080 O10G V2 GAMING" },
{ NVIDIA_VEN, NVIDIA_RTX3080TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3080TI_O12G_GAMING, 0x67, "ASUS ROG STRIX 3080Ti O12G GAMING" },
{ NVIDIA_VEN, NVIDIA_RTX3090_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3090_24G_GAMING, 0x67, "ASUS ROG STRIX 3090 24G GAMING" },
{ NVIDIA_VEN, NVIDIA_RTX3090_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3090_O24G_GAMING, 0x67, "ASUS ROG STRIX 3090 O24G GAMING" },
{ NVIDIA_VEN, NVIDIA_RTX3090_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3090_O24G_GAMING_WHITE, 0x67, "ASUS ROG STRIX 3090 O24G GAMING White OC" },
{ NVIDIA_VEN, NVIDIA_RTX3090_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_3090_O24G, 0x67, "ASUS TUF RTX 3090 O24G" },
@@ -57,7 +57,9 @@ static const gpu_pci_device device_list[] =
{ NVIDIA_VEN, NVIDIA_RTX2080_A_DEV, EVGA_SUB_VEN, EVGA_RTX2080_XC_GAMING_SUB_DEV, EVGA_RGB_V2, "EVGA GeForce RTX 2080 XC Gaming" },
{ NVIDIA_VEN, NVIDIA_RTX2080_A_DEV, EVGA_SUB_VEN, EVGA_RTX2080_XC_ULTRA_GAMING_SUB_DEV, EVGA_RGB_V2, "EVGA GeForce RTX 2080 XC Ultra Gaming" },
{ NVIDIA_VEN, NVIDIA_RTX2080S_DEV, EVGA_SUB_VEN, EVGA_RTX2080S_XC_GAMING_SUB_DEV, EVGA_RGB_V2, "EVGA GeForce RTX 2080 SUPER XC Gaming" },
{ NVIDIA_VEN, NVIDIA_RTX2080S_DEV, EVGA_SUB_VEN, EVGA_RTX2080S_XC_ULTRA_SUB_DEV, EVGA_RGB_V2, "EVGA GeForce RTX 2080 SUPER XC Ultra" },
{ NVIDIA_VEN, NVIDIA_RTX2080S_DEV, EVGA_SUB_VEN, EVGA_RTX2080S_FTW3_ULTRA_SUB_DEV, EVGA_RGB_V2, "EVGA GeForce RTX 2080 SUPER FTW3 Ultra" },
{ NVIDIA_VEN, NVIDIA_RTX2080S_DEV, EVGA_SUB_VEN, EVGA_RTX2080S_FTW3_HYBRID_OC_SUB_DEV, EVGA_RGB_V2, "EVGA GeForce RTX 2080 SUPER FTW3 Hybrid OC" },
{ NVIDIA_VEN, NVIDIA_RTX2080S_DEV, EVGA_SUB_VEN, EVGA_RTX2080S_FTW3_ULTRA_HC_SUB_DEV, EVGA_RGB_V2, "EVGA GeForce RTX 2080 SUPER FTW3 Ultra Hydro Copper" },
{ NVIDIA_VEN, NVIDIA_RTX2080TI_DEV, EVGA_SUB_VEN, EVGA_RTX2080TI_BLACK_SUB_DEV, EVGA_RGB_V2, "EVGA GeForce RTX 2080Ti Black" },
{ NVIDIA_VEN, NVIDIA_RTX2080TI_A_DEV, EVGA_SUB_VEN, EVGA_RTX2080TI_XC_ULTRA_GAMING_SUB_DEV, EVGA_RGB_V2, "EVGA GeForce RTX 2080Ti XC Ultra" },
@@ -27,11 +27,12 @@ static const gpu_pci_device device_list[] =
{ NVIDIA_VEN, NVIDIA_RTX2060S_OC_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RTX2060S_V1_SUB_DEV, 0x50, "Gigabyte AORUS RTX2060 SUPER 8G V1" },
{ NVIDIA_VEN, NVIDIA_RTX2070_OC_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RTX2070_XTREME_SUB_DEV, 0x50, "Gigabyte AORUS RTX2070 XTREME 8G" },
{ NVIDIA_VEN, NVIDIA_RTX2070S_OC_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX2070S_GAMING_OC_SUB_DEV2, 0x50, "Gigabyte AORUS RTX2070 SUPER 8G" },
{ NVIDIA_VEN, NVIDIA_RTX2080_A_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RTX2080_SUB_DEV, 0x50, "Gigabyte AORUS RTX2080 8G" },
{ NVIDIA_VEN, NVIDIA_RTX3060_LHR_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3060_ELITE_12GB_SUB_DEV, 0x70, "Gigabyte AORUS RTX3060 ELITE 12G" },
{ NVIDIA_VEN, NVIDIA_RTX3060TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3060TI_GAMING_OC_PRO_SUB_DEV, 0x62, "Gigabyte AORUS RTX3060 Ti GAMING OC PRO 8G" },
{ NVIDIA_VEN, NVIDIA_RTX3070_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3070_MASTER_OC_SUB_DEV, 0x66, "Gigabyte RTX3070 MASTER 8G" },
{ NVIDIA_VEN, NVIDIA_RTX3080_LHR_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3080_XTREME_WATERFORCE_SUB_DEV, 0x64, "Gigabyte AORUS RTX3080 XTREME WATERFORCE WB 10G" },
{ NVIDIA_VEN, NVIDIA_RTX3080TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3080TI_VISION_OC_SUB_DEV, 0x63, "Gigabyte RTX3080 Ti Vision OC 12G" },
{ NVIDIA_VEN, NVIDIA_RTX3080TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3080TI_VISION_OC_SUB_DEV, 0x63, "Gigabyte RTX3080 Ti Vision OC 12G" },
{ NVIDIA_VEN, NVIDIA_RTX3080TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3080TI_XTREME_WATERFORCE_SUB_DEV, 0x65, "Gigabyte AORUS RTX3080 Ti XTREME WATERFORCE 12G" },
{ NVIDIA_VEN, NVIDIA_RTX3090_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3090_XTREME_WATERFORCE_SUB_DEV, 0x64, "Gigabyte AORUS RTX3090 XTREME WATERFORCE WB 24G" },
};
@@ -27,6 +27,7 @@ enum
RGB_FUSION_GPU_MODE_BREATHING = 0x02,
RGB_FUSION_GPU_MODE_FLASHING = 0x04,
RGB_FUSION_GPU_MODE_DUAL_FLASHING = 0x08,
RGB_FUSION_GPU_MODE_COLOR_CYCLE = 0x10,
RGB_FUSION_GPU_MODE_SPECTRUM_CYCLE = 0x11
};
@@ -63,6 +63,7 @@ static const gpu_pci_device device_list[] =
{ NVIDIA_VEN, NVIDIA_RTX3070_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3070_GAMING_OC_SUB_DEV, 0x62, "Gigabyte RTX3070 Gaming OC 8G" },
{ NVIDIA_VEN, NVIDIA_RTX3070_LHR_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3070_GAMING_OC_SUB_DEV, 0x62, "Gigabyte RTX3070 Gaming OC 8G v3.0 LHR" },
{ NVIDIA_VEN, NVIDIA_RTX3070_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3070_VISION_OC_SUB_DEV, 0x63, "Gigabyte RTX3070 Vision 8G" },
{ NVIDIA_VEN, NVIDIA_RTX3070_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3070_EAGLE_OC_SUB_DEV, 0x63, "Gigabyte RTX3070 Eagle OC 8G" },
{ NVIDIA_VEN, NVIDIA_RTX3070TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3070TI_GAMING_OC_SUB_DEV, 0x62, "Gigabyte RTX3070 Ti Gaming OC 8G" },
{ NVIDIA_VEN, NVIDIA_RTX3070TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3070TI_EAGLE_SUB_DEV, 0x63, "Gigabyte RTX3070 Ti EAGLE 8G" },
{ NVIDIA_VEN, NVIDIA_RTX3070TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3070TI_VISION_OC_SUB_DEV, 0x63, "Gigabyte RTX3070 Ti Vision OC 8G" },
@@ -69,6 +69,16 @@ RGBController_RGBFusionGPU::RGBController_RGBFusionGPU(RGBFusionGPUController* r
DualFlashing.brightness = RGB_FUSION_GPU_BRIGHTNESS_MAX;
modes.push_back(DualFlashing);
mode ColorCycle;
ColorCycle.name = "Color Cycle";
ColorCycle.value = RGB_FUSION_GPU_MODE_COLOR_CYCLE | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
ColorCycle.flags = MODE_FLAG_HAS_SPEED;
ColorCycle.speed_min = RGB_FUSION_GPU_SPEED_SLOWEST;
ColorCycle.speed_max = RGB_FUSION_GPU_SPEED_FASTEST;
ColorCycle.speed = RGB_FUSION_GPU_SPEED_NORMAL;
ColorCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(ColorCycle);
mode SpectrumCycle;
SpectrumCycle.name = "Spectrum Cycle";
SpectrumCycle.value = RGB_FUSION_GPU_MODE_SPECTRUM_CYCLE;
@@ -886,4 +886,4 @@ REGISTER_HID_DETECTOR_IPU("Logitech G900 Wireless Gaming Mouse (wired)",
REGISTER_HID_DETECTOR_IPU("Logitech G903 Wireless Gaming Mouse (wired)", DetectLogitechWired, LOGITECH_VID, LOGITECH_G903_LIGHTSPEED_PID, 1, 0xFF00, 2);
REGISTER_HID_DETECTOR_IPU("Logitech G903 Hero Wireless Gaming Mouse (wired)", DetectLogitechWired, LOGITECH_VID, LOGITECH_G903_LIGHTSPEED_HERO_PID, 1, 0xFF00, 2);
REGISTER_HID_DETECTOR_IPU("Logitech G Pro Wireless Gaming Mouse (wired)", DetectLogitechWired, LOGITECH_VID, LOGITECH_G_PRO_WIRELESS_PID, 2, 0xFF00, 2);
REGISTER_HID_DETECTOR_IPU("Logitech G733 Gaming Headset", DetectLogitechWired, LOGITECH_VID, LOGITECH_G733_PID, 2, 0xFF43, 514);
REGISTER_HID_DETECTOR_IPU("Logitech G733 Gaming Headset", DetectLogitechWired, LOGITECH_VID, LOGITECH_G733_PID, 3, 0xFF43, 514);
@@ -22,7 +22,7 @@ static unsigned int matrix_map[7][27] =
{ 112, NA, 49, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, NA, 41, 42, 38, NA, NA, 69, 70, 71, NA, 79, 80, 81, 82 },
{ 113, NA, 39, NA, 16, 22, 4, 17, NA, 19, 24, 20, 8, 14, 15, 43, 44, 45, NA, 72, 73, 74, NA, 91, 92, 93, 83 },
{ 114, NA, 53, NA, 0, 18, 3, 5, NA, 6, 7, 9, 10, 11, 47, 48, 46, 36, NA, NA, NA, NA, NA, 88, 89, 90, NA },
{ 115, NA, 99, NA, 25, 23, 2, 21, NA, 1, NA, 13, 12, 50, 51, 52, 103, NA, NA, NA, 78, NA, NA, 85, 86, 87, 84 },
{ 115, NA, 99, 96, 25, 23, 2, 21, NA, 1, NA, 13, 12, 50, 51, 52, 103, NA, NA, NA, 78, NA, NA, 85, 86, 87, 84 },
{ 116, NA, 98, 101, 100, NA, NA, NA, NA, 40, NA, NA, NA, NA, 104, 105, 97, 102, NA, 76, 77, 75, NA, 94, NA, 95, NA } };
static const char* zone_names[] =
@@ -181,7 +181,7 @@ void RGBController_LogitechLightspeed::UpdateZoneLEDs(int zone)
/*---------------------------------------------------------*\
| Workaround for G502 mode breathing / spectrum cycle swap |
\*---------------------------------------------------------*/
bool bright_cycle_swap = (pid == 0xC08B || pid == 0xC332);
bool bright_cycle_swap = (pid == 0xC08B || pid == 0xC332 || pid == 0x0AB5);
/*---------------------------------------------------------*\
| Replace direct mode with static when sending to controller|
@@ -44,7 +44,8 @@ static const gpu_pci_device device_list[] =
{ NVIDIA_VEN, NVIDIA_RTX3080_DEV, PALIT_SUB_VEN, PALIT_RTX3080_SUB_DEV, PNY_RGB, "Palit 3080" },
{ NVIDIA_VEN, NVIDIA_RTX3080_LHR_DEV, PALIT_SUB_VEN, PALIT_RTX3080_LHR_SUB_DEV, PNY_RGB, "Palit 3080 LHR" },
{ NVIDIA_VEN, NVIDIA_RTX3080TI_DEV, PALIT_SUB_VEN, PALIT_RTX3080TI_SUB_DEV, PNY_RGB, "Palit 3080Ti" },
{ NVIDIA_VEN, NVIDIA_RTX3090_DEV, PALIT_SUB_VEN, PALIT_RTX3090_SUB_DEV, PNY_RGB, "Palit 3090" }
{ NVIDIA_VEN, NVIDIA_RTX3090_DEV, PALIT_SUB_VEN, PALIT_RTX3090_SUB_DEV, PNY_RGB, "Palit 3090" },
{ NVIDIA_VEN, NVIDIA_RTX2080S_DEV, NVIDIA_SUB_VEN, NVIDIA_RTX2080S_DEV, PNY_RGB, "NVIDIA RTX2080S" },
};
/******************************************************************************************\
@@ -13,9 +13,11 @@
#include "Detector.h"
#include "QMKOpenRGBRev9Controller.h"
#include "QMKOpenRGBRevBController.h"
#include "QMKOpenRGBRevDController.h"
#include "RGBController.h"
#include "RGBController_QMKOpenRGBRev9.h"
#include "RGBController_QMKOpenRGBRevB.h"
#include "RGBController_QMKOpenRGBRevD.h"
#include "LogManager.h"
#include <hidapi/hidapi.h>
@@ -25,6 +27,7 @@
#define QMK_OPENRGB_PROTOCOL_VERSION_9 0x09
#define QMK_OPENRGB_PROTOCOL_VERSION_B 0x0B
#define QMK_OPENRGB_PROTOCOL_VERSION_C 0x0C
#define QMK_OPENRGB_PROTOCOL_VERSION_D 0x0D
/*-----------------------------------------------------*\
| Usage and Usage Page |
@@ -93,6 +96,13 @@ void DetectQMKOpenRGBControllers(hid_device_info *info, const std::string&)
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
break;
case QMK_OPENRGB_PROTOCOL_VERSION_D:
{
QMKOpenRGBRevDController* controller = new QMKOpenRGBRevDController(dev, info->path);
RGBController_QMKOpenRGBRevD* rgb_controller = new RGBController_QMKOpenRGBRevD(controller, true);
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
break;
default:
if (version == 0)
{
@@ -105,7 +115,7 @@ void DetectQMKOpenRGBControllers(hid_device_info *info, const std::string&)
"For officaly supported QMK boards grab <a href=\"https://github.com/Kasper24/QMK-OpenRGB\">url</a> \n"
"For Sonix boards grab <a href=\"https://github.com/SonixQMK/qmk_firmware/tree/sn32_openrgb\">url</a>", version);
}
else if (version > QMK_OPENRGB_PROTOCOL_VERSION_C)
else if (version > QMK_OPENRGB_PROTOCOL_VERSION_D)
{
LOG_WARNING("[QMK OpenRGB] Detection failed - the detected keyboard is using version protocol %i which is not supported by this OpenRGB build. Please update OpenRGB!", version);
}
@@ -0,0 +1,525 @@
/*-------------------------------------------------------------------*\
| QMKOpenRGBRevDController.cpp |
| |
| Driver for QMK keyboards using OpenRGB Protocol (Revision D) |
| |
| Kasper 10th Octobber 2020 |
| Jath03 28th May 2021 |
\*-------------------------------------------------------------------*/
#include "QMKOpenRGBRevDController.h"
using namespace std::chrono_literals;
static std::map<uint8_t, std::string> QMKKeycodeToKeynameMap
{
{ 0, "" }, { 1, "Right Fn" }, { 2, "" }, { 3, "" },
{ 4, "A" }, { 5, "B" }, { 6, "C" }, { 7, "D" },
{ 8, "E" }, { 9, "F" }, { 10, "G" }, { 11, "H" },
{ 12, "I" }, { 13, "J" }, { 14, "K" }, { 15, "L" },
{ 16, "M" }, { 17, "N" }, { 18, "O" }, { 19, "P" },
{ 20, "Q" }, { 21, "R" }, { 22, "S" }, { 23, "T" },
{ 24, "U" }, { 25, "V" }, { 26, "W" }, { 27, "X" },
{ 28, "Y" }, { 29, "Z" }, { 30, "1" }, { 31, "2" },
{ 32, "3" }, { 33, "4" }, { 34, "5" }, { 35, "6" },
{ 36, "7" }, { 37, "8" }, { 38, "9" }, { 39, "0" },
{ 40, "Enter" }, { 41, "Escape" }, { 42, "Backspace" }, { 43, "Tab" },
{ 44, "Space" }, { 45, "-" }, { 46, "=" }, { 47, "[" },
{ 48, "]" }, { 49, "\\ (ANSI)" }, { 50, "" }, { 51, ";" },
{ 52, "'" }, { 53, "`" }, { 54, "," }, { 55, "." },
{ 56, "/" }, { 57, "Caps Lock" }, { 58, "F1" }, { 59, "F2" },
{ 60, "F3" }, { 61, "F4" }, { 62, "F5" }, { 63, "F6" },
{ 64, "F7" }, { 65, "F8" }, { 66, "F9" }, { 67, "F10" },
{ 68, "F11" }, { 69, "F12" }, { 70, "Print Screen" }, { 71, "Scroll Lock" },
{ 72, "Pause/Break" }, { 73, "Insert" }, { 74, "Home" }, { 75, "Page Up" },
{ 76, "Delete" }, { 77, "End" }, { 78, "Page Down" }, { 79, "Right Arrow" },
{ 80, "Left Arrow" }, { 81, "Down Arrow" }, { 82, "Up Arrow" }, { 83, "Num Lock" },
{ 84, "Number Pad /" }, { 85, "Number Pad *" }, { 86, "Number Pad -" }, { 87, "Number Pad +" },
{ 88, "Number Pad Enter" }, { 89, "Number Pad 1" }, { 90, "Number Pad 2" }, { 91, "Number Pad 3" },
{ 92, "Number Pad 4" }, { 93, "Number Pad 5" }, { 94, "Number Pad 6" }, { 95, "Number Pad 7" },
{ 96, "Number Pad 8" }, { 97, "Number Pad 9" }, { 98, "Number Pad 0" }, { 99, "Number Pad ." },
{ 100, "" }, { 101, "Menu" }, { 102, "" }, { 103, "" },
{ 104, "" }, { 105, "" }, { 106, "" }, { 107, "" },
{ 108, "" }, { 109, "" }, { 110, "" }, { 111, "" },
{ 112, "" }, { 113, "" }, { 114, "" }, { 115, "" },
{ 116, "" }, { 117, "" }, { 118, "" }, { 119, "" },
{ 120, "" }, { 121, "" }, { 122, "" }, { 123, "" },
{ 124, "" }, { 125, "" }, { 126, "" }, { 127, "" },
{ 128, "" }, { 129, "" }, { 130, "" }, { 131, "" },
{ 132, "" }, { 133, "" }, { 134, "" }, { 135, "" },
{ 136, "" }, { 137, "" }, { 138, "" }, { 139, "" },
{ 140, "" }, { 141, "" }, { 142, "" }, { 143, "" },
{ 144, "" }, { 145, "" }, { 146, "" }, { 147, "" },
{ 148, "" }, { 149, "" }, { 150, "" }, { 151, "" },
{ 152, "" }, { 153, "" }, { 154, "" }, { 155, "" },
{ 156, "" }, { 157, "" }, { 158, "" }, { 159, "" },
{ 160, "" }, { 161, "" }, { 162, "" }, { 163, "" }, { 164, "" },
/*Space Cadet Left Shift*/ { 216, "Left Shift"}, /*Space Cadet Right Shift*/ { 217, "Right Shift"},
{ 224, "Left Control" }, { 225, "Left Shift" }, { 226, "Left Alt" }, { 227, "Left Windows" },
{ 228, "Right Control" }, { 229, "Right Shift" }, { 230, "Right Alt" }, { 231, "Right Windows" },
};
QMKOpenRGBRevDController::QMKOpenRGBRevDController(hid_device *dev_handle, const char *path)
{
/*-------------------------------------------------*\
| Get QMKOpenRGB settings |
\*-------------------------------------------------*/
json qmk_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("QMKOpenRGBDevices");
if(qmk_settings.contains("leds_per_update"))
{
if(qmk_settings["leds_per_update"] > 15)
{
qmk_settings["leds_per_update"] = 15;
}
else if(qmk_settings["leds_per_update"] < 1)
{
qmk_settings["leds_per_update"] = 1;
}
SettingsManager* settings_manager = ResourceManager::get()->GetSettingsManager();
settings_manager->SetSettings("QMKOpenRGBDevices", qmk_settings);
settings_manager->SaveSettings();
leds_per_update = qmk_settings["leds_per_update"];
}
else
{
leds_per_update = 15;
}
if(qmk_settings.contains("delay"))
{
delay = (unsigned int)qmk_settings["delay"] * 1ms;
}
else
{
delay = 0ms;
}
dev = dev_handle;
location = path;
GetDeviceInfo();
GetModeInfo();
}
QMKOpenRGBRevDController::~QMKOpenRGBRevDController()
{
hid_close(dev);
}
std::string QMKOpenRGBRevDController::GetLocation()
{
return location;
}
std::string QMKOpenRGBRevDController::GetDeviceName()
{
return device_name;
}
std::string QMKOpenRGBRevDController::GetDeviceVendor()
{
return device_vendor;
}
unsigned int QMKOpenRGBRevDController::GetTotalNumberOfLEDs()
{
return total_number_of_leds;
}
unsigned int QMKOpenRGBRevDController::GetTotalNumberOfLEDsWithEmptySpace()
{
return total_number_of_leds_with_empty_space;
}
unsigned int QMKOpenRGBRevDController::GetMode()
{
return mode;
}
unsigned int QMKOpenRGBRevDController::GetModeSpeed()
{
return mode_speed;
}
unsigned int QMKOpenRGBRevDController::GetModeColor()
{
return mode_color;
}
std::vector<point_t> QMKOpenRGBRevDController::GetLEDPoints()
{
return led_points;
}
std::vector<unsigned int> QMKOpenRGBRevDController::GetLEDFlags()
{
return led_flags;
}
std::vector<std::string> QMKOpenRGBRevDController::GetLEDNames()
{
return led_names;
}
std::vector<RGBColor> QMKOpenRGBRevDController::GetLEDColors()
{
return led_colors;
}
std::vector<unsigned int> QMKOpenRGBRevDController::GetLEDValues()
{
return led_values;
}
unsigned int QMKOpenRGBRevDController::GetProtocolVersion()
{
unsigned char usb_buf[QMK_OPENRGB_PACKET_SIZE];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, QMK_OPENRGB_PACKET_SIZE);
/*-----------------------------------------------------*\
| Set up config table request packet |
\*-----------------------------------------------------*/
usb_buf[0x00] = 0x00;
usb_buf[0x01] = QMK_OPENRGB_GET_PROTOCOL_VERSION;
int bytes_read = 0;
do
{
hid_write(dev, usb_buf, QMK_OPENRGB_PACKET_SIZE);
bytes_read = hid_read_timeout(dev, usb_buf, QMK_OPENRGB_PACKET_SIZE, QMK_OPENRGB_HID_READ_TIMEOUT);
} while(bytes_read <= 0);
return usb_buf[1];
}
std::string QMKOpenRGBRevDController::GetQMKVersion()
{
unsigned char usb_buf[QMK_OPENRGB_PACKET_SIZE];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, QMK_OPENRGB_PACKET_SIZE);
/*-----------------------------------------------------*\
| Set up config table request packet |
\*-----------------------------------------------------*/
usb_buf[0x00] = 0x00;
usb_buf[0x01] = QMK_OPENRGB_GET_QMK_VERSION;
hid_write(dev, usb_buf, QMK_OPENRGB_PACKET_SIZE);
hid_read(dev, usb_buf, QMK_OPENRGB_PACKET_SIZE);
std::string qmk_version;
int i = 1;
while (usb_buf[i] != 0)
{
qmk_version.push_back(usb_buf[i]);
i++;
}
return qmk_version;
}
void QMKOpenRGBRevDController::GetDeviceInfo()
{
unsigned char usb_buf[QMK_OPENRGB_PACKET_SIZE];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, QMK_OPENRGB_PACKET_SIZE);
/*-----------------------------------------------------*\
| Set up config table request packet |
\*-----------------------------------------------------*/
usb_buf[0x00] = 0x00;
usb_buf[0x01] = QMK_OPENRGB_GET_DEVICE_INFO;
int bytes_read = 0;
do
{
hid_write(dev, usb_buf, QMK_OPENRGB_PACKET_SIZE);
bytes_read = hid_read_timeout(dev, usb_buf, QMK_OPENRGB_PACKET_SIZE, QMK_OPENRGB_HID_READ_TIMEOUT);
} while(bytes_read <= 0);
total_number_of_leds = usb_buf[QMK_OPENRGB_TOTAL_NUMBER_OF_LEDS_BYTE];
total_number_of_leds_with_empty_space = usb_buf[QMK_OPENRGB_TOTAL_NUMBER_OF_LEDS_WITH_EMPTY_SPACE_BYTE];
int i = QMK_OPENRGB_TOTAL_NUMBER_OF_LEDS_WITH_EMPTY_SPACE_BYTE + 1;
while (usb_buf[i] != 0)
{
device_name.push_back(usb_buf[i]);
i++;
}
i++;
while (usb_buf[i] != 0)
{
device_vendor.push_back(usb_buf[i]);
i++;
}
}
void QMKOpenRGBRevDController::GetModeInfo()
{
unsigned char usb_buf[QMK_OPENRGB_PACKET_SIZE];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, QMK_OPENRGB_PACKET_SIZE);
/*-----------------------------------------------------*\
| Set up config table request packet |
\*-----------------------------------------------------*/
usb_buf[0x00] = 0x00;
usb_buf[0x01] = QMK_OPENRGB_GET_MODE_INFO;
int bytes_read = 0;
do
{
hid_write(dev, usb_buf, 65);
bytes_read = hid_read_timeout(dev, usb_buf, 65, QMK_OPENRGB_HID_READ_TIMEOUT);
} while(bytes_read <= 0);
mode = usb_buf[QMK_OPENRGB_MODE_BYTE];
mode_speed = usb_buf[QMK_OPENRGB_SPEED_BYTE];
/*-----------------------------------------------------*\
| QMK hue range is between 0-255 so hue needs to be |
| converted |
\*-----------------------------------------------------*/
unsigned int oldRange = 255;
unsigned int newRange = 359;
unsigned int convertedHue = (usb_buf[QMK_OPENRGB_HUE_BYTE] * newRange / oldRange);
hsv_t hsv;
hsv.hue = convertedHue;
hsv.saturation = usb_buf[QMK_OPENRGB_SATURATION_BYTE];
hsv.value = usb_buf[QMK_OPENRGB_VALUE_BYTE];
mode_color = hsv2rgb(&hsv);
}
void QMKOpenRGBRevDController::GetLEDInfo(unsigned int leds_count)
{
unsigned int leds_sent = 0;
unsigned int leds_per_update_info = 8;
std::vector<point_t> underglow_points;
std::vector<unsigned int> underglow_flags;
std::vector<std::string> underglow_names;
std::vector<RGBColor> underglow_colors;
std::vector<unsigned int> underglow_values;
while (leds_sent < leds_count)
{
if ((leds_count - leds_sent) < leds_per_update_info)
{
leds_per_update_info = leds_count - leds_sent;
}
unsigned char usb_buf[QMK_OPENRGB_PACKET_SIZE];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, QMK_OPENRGB_PACKET_SIZE);
/*-----------------------------------------------------*\
| Set up config table request packet |
\*-----------------------------------------------------*/
usb_buf[0x00] = 0x00;
usb_buf[0x01] = QMK_OPENRGB_GET_LED_INFO;
usb_buf[0x02] = leds_sent;
usb_buf[0x03] = leds_per_update_info;
int bytes_read = 0;
do
{
hid_write(dev, usb_buf, QMK_OPENRGB_PACKET_SIZE);
bytes_read = hid_read_timeout(dev, usb_buf, QMK_OPENRGB_PACKET_SIZE, QMK_OPENRGB_HID_READ_TIMEOUT);
} while(bytes_read <= 0);
for (unsigned int led_idx = 0; led_idx < leds_per_update_info; led_idx++)
{
if(usb_buf[(led_idx * 7) + QMK_OPENRGB_FLAG_BYTE] != QMK_OPENRGB_FAILURE)
{
if(usb_buf[(led_idx * 7) + QMK_OPENRGB_FLAG_BYTE] & 2)
{
underglow_points.push_back(point_t{usb_buf[(led_idx * 7) + QMK_OPENRGB_POINT_X_BYTE], usb_buf[(led_idx * 7) + QMK_OPENRGB_POINT_Y_BYTE]});
underglow_flags.push_back(usb_buf[(led_idx * 7) + QMK_OPENRGB_FLAG_BYTE]);
underglow_colors.push_back(ToRGBColor(usb_buf[(led_idx * 7) + QMK_OPENRGB_R_COLOR_BYTE], usb_buf[(led_idx * 7) + QMK_OPENRGB_G_COLOR_BYTE], usb_buf[(led_idx * 7) + QMK_OPENRGB_B_COLOR_BYTE]));
underglow_values.push_back(underglow_values.size() + led_values.size());
}
else
{
led_points.push_back(point_t{usb_buf[(led_idx * 7) + QMK_OPENRGB_POINT_X_BYTE], usb_buf[(led_idx * 7) + QMK_OPENRGB_POINT_Y_BYTE]});
led_flags.push_back(usb_buf[(led_idx * 7) + QMK_OPENRGB_FLAG_BYTE]);
led_colors.push_back(ToRGBColor(usb_buf[(led_idx * 7) + QMK_OPENRGB_R_COLOR_BYTE], usb_buf[(led_idx * 7) + QMK_OPENRGB_G_COLOR_BYTE], usb_buf[(led_idx * 7) + QMK_OPENRGB_B_COLOR_BYTE]));
led_values.push_back(underglow_values.size() + led_values.size());
}
}
if(usb_buf[(led_idx * 7) + QMK_OPENRGB_KEYCODE_BYTE] != 0)
{
if (QMKKeycodeToKeynameMap.count(usb_buf[(led_idx * 7) + QMK_OPENRGB_KEYCODE_BYTE]) > 0)
{
led_names.push_back("Key: " + QMKKeycodeToKeynameMap[usb_buf[(led_idx * 7) + QMK_OPENRGB_KEYCODE_BYTE]]);
}
else
{
led_names.push_back("Key: ");
}
}
else if(usb_buf[(led_idx * 7) + QMK_OPENRGB_FLAG_BYTE] & 2){
underglow_names.push_back("Underglow: " + std::to_string(underglow_names.size() + led_names.size()));
}
}
leds_sent += leds_per_update_info;
}
led_points.insert(led_points.end(), underglow_points.begin(), underglow_points.end());
led_flags.insert(led_flags.end(), underglow_flags.begin(), underglow_flags.end());
led_colors.insert(led_colors.end(), underglow_colors.begin(), underglow_colors.end());
led_names.insert(led_names.end(), underglow_names.begin(), underglow_names.end());
led_values.insert(led_values.end(), underglow_values.begin(), underglow_values.end());
}
std::vector<unsigned int> QMKOpenRGBRevDController::GetEnabledModes()
{
unsigned char usb_buf[QMK_OPENRGB_PACKET_SIZE];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, QMK_OPENRGB_PACKET_SIZE);
/*-----------------------------------------------------*\
| Set up config table request packet |
\*-----------------------------------------------------*/
usb_buf[0x00] = 0x00;
usb_buf[0x01] = QMK_OPENRGB_GET_ENABLED_MODES;
int bytes_read = 0;
do
{
hid_write(dev, usb_buf, QMK_OPENRGB_PACKET_SIZE);
bytes_read = hid_read_timeout(dev, usb_buf, QMK_OPENRGB_PACKET_SIZE, QMK_OPENRGB_HID_READ_TIMEOUT);
} while(bytes_read <= 0);
std::vector<unsigned int> enabled_modes;
int i = 1;
while (usb_buf[i] != 0)
{
enabled_modes.push_back(usb_buf[i]);
i++;
}
return enabled_modes;
}
void QMKOpenRGBRevDController::SetMode(hsv_t hsv_color, unsigned char mode, unsigned char speed, bool save)
{
unsigned char usb_buf[QMK_OPENRGB_PACKET_SIZE];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, QMK_OPENRGB_PACKET_SIZE);
/*-----------------------------------------------------*\
| Set up config table request packet |
\*-----------------------------------------------------*/
usb_buf[0x00] = 0x00;
usb_buf[0x01] = QMK_OPENRGB_SET_MODE;
usb_buf[0x02] = hsv_color.hue * 255 / 359;
usb_buf[0x03] = hsv_color.saturation;
usb_buf[0x04] = hsv_color.value;
usb_buf[0x05] = mode;
usb_buf[0x06] = speed;
usb_buf[0x07] = save;
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, usb_buf, 65);
hid_read_timeout(dev, usb_buf, 65, QMK_OPENRGB_HID_READ_TIMEOUT);
}
void QMKOpenRGBRevDController::DirectModeSetSingleLED(unsigned int led, unsigned char red, unsigned char green, unsigned char blue)
{
unsigned char usb_buf[QMK_OPENRGB_PACKET_SIZE];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, QMK_OPENRGB_PACKET_SIZE);
/*-----------------------------------------------------*\
| Set up config table request packet |
\*-----------------------------------------------------*/
usb_buf[0x00] = 0x00;
usb_buf[0x01] = QMK_OPENRGB_DIRECT_MODE_SET_SINGLE_LED;
usb_buf[0x02] = led_values[led];
usb_buf[0x03] = red;
usb_buf[0x04] = green;
usb_buf[0x05] = blue;
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, usb_buf, 65);
hid_read_timeout(dev, usb_buf, 65, QMK_OPENRGB_HID_READ_TIMEOUT);
}
void QMKOpenRGBRevDController::DirectModeSetLEDs(std::vector<RGBColor> colors, unsigned int leds_count)
{
unsigned int leds_sent = 0;
unsigned int tmp_leds_per_update = leds_per_update;
while (leds_sent < leds_count)
{
if ((leds_count - leds_sent) < tmp_leds_per_update)
{
tmp_leds_per_update = leds_count - leds_sent;
}
unsigned char usb_buf[QMK_OPENRGB_PACKET_SIZE];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, QMK_OPENRGB_PACKET_SIZE);
/*-----------------------------------------------------*\
| Set up config table request packet |
\*-----------------------------------------------------*/
usb_buf[0x00] = 0x00;
usb_buf[0x01] = QMK_OPENRGB_DIRECT_MODE_SET_LEDS;
usb_buf[0x02] = tmp_leds_per_update;
for (unsigned int led_idx = 0; led_idx < tmp_leds_per_update; led_idx++)
{
usb_buf[(led_idx * 4) + 3] = led_values[led_idx + leds_sent];
usb_buf[(led_idx * 4) + 4] = RGBGetRValue(colors[led_idx + leds_sent]);
usb_buf[(led_idx * 4) + 5] = RGBGetGValue(colors[led_idx + leds_sent]);
usb_buf[(led_idx * 4) + 6] = RGBGetBValue(colors[led_idx + leds_sent]);
}
hid_write(dev, usb_buf, 65);
if(delay > 0ms)
{
std::this_thread::sleep_for(delay);
}
leds_sent += tmp_leds_per_update;
}
}
@@ -0,0 +1,72 @@
/*-------------------------------------------------------------------*\
| QMKOpenRGBRevDController.h |
| |
| Driver for QMK keyboards using OpenRGB Protocol (Revision D) |
| |
| Kasper 10th Octobber 2020 |
| Jath03 28th May 2021 |
\*-------------------------------------------------------------------*/
#pragma once
#include "QMKOpenRGBController.h"
class QMKOpenRGBRevDController
{
public:
QMKOpenRGBRevDController(hid_device *dev_handle, const char *path);
~QMKOpenRGBRevDController();
std::string GetLocation();
std::string GetDeviceName();
std::string GetDeviceVendor();
unsigned int GetTotalNumberOfLEDs();
unsigned int GetTotalNumberOfLEDsWithEmptySpace();
unsigned int GetMode();
unsigned int GetModeSpeed();
unsigned int GetModeColor();
std::vector<point_t> GetLEDPoints();
std::vector<unsigned int> GetLEDFlags();
std::vector<std::string> GetLEDNames();
std::vector<RGBColor> GetLEDColors();
std::vector<unsigned int> GetLEDValues();
unsigned int GetProtocolVersion();
std::string GetQMKVersion();
void GetDeviceInfo();
void GetModeInfo();
void GetLEDInfo(unsigned int leds_count);
std::vector<unsigned int> GetEnabledModes();
void SetMode(hsv_t hsv_color, unsigned char mode, unsigned char speed, bool save);
void DirectModeSetSingleLED(unsigned int led, unsigned char red, unsigned char green, unsigned char blue);
void DirectModeSetLEDs(std::vector<RGBColor> colors, unsigned int num_colors);
protected:
hid_device *dev;
private:
unsigned int leds_per_update;
std::string location;
std::string device_name;
std::string device_vendor;
std::chrono::milliseconds delay;
unsigned int total_number_of_leds;
unsigned int total_number_of_leds_with_empty_space;
unsigned int mode;
unsigned int mode_speed;
RGBColor mode_color;
std::vector<point_t> led_points;
std::vector<unsigned int> led_flags;
std::vector<std::string> led_names;
std::vector<RGBColor> led_colors;
std::vector<unsigned int> led_values;
};
@@ -0,0 +1,783 @@
/*-------------------------------------------------------------------*\
| RGBController_QMKOpenRGBRevD.cpp |
| |
| Driver for QMK keyboards using OpenRGB Protocol (Revision D) |
| |
| Kasper 10th Octobber 2020 |
| Jath03 28th May 2021 |
\*-------------------------------------------------------------------*/
#include "hsv.h"
#include "LogManager.h"
#include "RGBController_QMKOpenRGBRevD.h"
RGBController_QMKOpenRGBRevD::RGBController_QMKOpenRGBRevD(QMKOpenRGBRevDController* controller_ptr, bool save)
{
controller = controller_ptr;
name = controller->GetDeviceName();
vendor = controller->GetDeviceVendor();
description = "QMK OpenRGB Device (Protocol Version " + std::to_string(controller->GetProtocolVersion()) + ")";
type = DEVICE_TYPE_KEYBOARD;
location = controller->GetLocation();
version = controller->GetQMKVersion();
unsigned int current_mode = 1;
std::vector<unsigned int> enabled_modes = controller->GetEnabledModes();
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_SOLID_COLOR) != enabled_modes.end())
{
InitializeMode("Static", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_ALPHA_MOD) != enabled_modes.end())
{
InitializeMode("Alpha Mod", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_GRADIENT_UP_DOWN) != enabled_modes.end())
{
InitializeMode("Gradient Up Down", current_mode, MODE_FLAG_HAS_SPEED, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_GRADIENT_LEFT_RIGHT) != enabled_modes.end())
{
InitializeMode("Gradient Left Right", current_mode, MODE_FLAG_HAS_SPEED, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_BREATHING) != enabled_modes.end())
{
InitializeMode("Breathing", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_BAND_SAT) != enabled_modes.end())
{
InitializeMode("Band Saturation", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_BAND_VAL) != enabled_modes.end())
{
InitializeMode("Band Value", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_BAND_PINWHEEL_SAT) != enabled_modes.end())
{
InitializeMode("Band Pinwheel Saturation", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_BAND_PINWHEEL_VAL) != enabled_modes.end())
{
InitializeMode("Band Pinwheel Value", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_BAND_SPIRAL_SAT) != enabled_modes.end())
{
InitializeMode("Band Spiral Saturation", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_BAND_SPIRAL_VAL) != enabled_modes.end())
{
InitializeMode("Band Spiral Value", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_CYCLE_ALL) != enabled_modes.end())
{
InitializeMode("Cycle All", current_mode, MODE_FLAG_HAS_SPEED, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_CYCLE_LEFT_RIGHT) != enabled_modes.end())
{
InitializeMode("Cycle Left Right", current_mode, MODE_FLAG_HAS_SPEED, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_CYCLE_UP_DOWN) != enabled_modes.end())
{
InitializeMode("Cycle Up Down", current_mode, MODE_FLAG_HAS_SPEED, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_CYCLE_OUT_IN) != enabled_modes.end())
{
InitializeMode("Cycle Out In", current_mode, MODE_FLAG_HAS_SPEED, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_CYCLE_OUT_IN_DUAL) != enabled_modes.end())
{
InitializeMode("Cycle Out In Dual", current_mode, MODE_FLAG_HAS_SPEED, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_RAINBOW_MOVING_CHEVRON) != enabled_modes.end())
{
InitializeMode("Rainbow Moving Chevron", current_mode, MODE_FLAG_HAS_SPEED, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_CYCLE_PINWHEEL) != enabled_modes.end())
{
InitializeMode("Cycle Pinwheel", current_mode, MODE_FLAG_HAS_SPEED, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_CYCLE_SPIRAL) != enabled_modes.end())
{
InitializeMode("Cycle Spiral", current_mode, MODE_FLAG_HAS_SPEED, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_DUAL_BEACON) != enabled_modes.end())
{
InitializeMode("Dual Beacon", current_mode, MODE_FLAG_HAS_SPEED, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_RAINBOW_BEACON) != enabled_modes.end())
{
InitializeMode("Rainbow Beacon", current_mode, MODE_FLAG_HAS_SPEED, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_RAINBOW_PINWHEELS) != enabled_modes.end())
{
InitializeMode("Rainbow Pinwheels", current_mode, MODE_FLAG_HAS_SPEED, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_RAINDROPS) != enabled_modes.end())
{
InitializeMode("Raindrops", current_mode, 0, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_JELLYBEAN_RAINDROPS) != enabled_modes.end())
{
InitializeMode("Jellybean Raindrops", current_mode, 0, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_HUE_BREATHING) != enabled_modes.end())
{
InitializeMode("Hue Breathing", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_HUE_PENDULUM) != enabled_modes.end())
{
InitializeMode("Hue Pendulum", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_HUE_WAVE) != enabled_modes.end())
{
InitializeMode("Hue Wave", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_TYPING_HEATMAP) != enabled_modes.end())
{
InitializeMode("Typing Heatmap", current_mode, 0, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_DIGITAL_RAIN) != enabled_modes.end())
{
InitializeMode("Digital Rain", current_mode, 0, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_SOLID_REACTIVE_SIMPLE) != enabled_modes.end())
{
InitializeMode("Solid Reactive Simple", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_SOLID_REACTIVE) != enabled_modes.end())
{
InitializeMode("Solid Reactive", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_SOLID_REACTIVE_WIDE) != enabled_modes.end())
{
InitializeMode("Solid Reactive Wide", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_SOLID_REACTIVE_MULTIWIDE) != enabled_modes.end())
{
InitializeMode("Solid Reactive Multi Wide", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_SOLID_REACTIVE_CROSS) != enabled_modes.end())
{
InitializeMode("Solid Reactive Cross", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_SOLID_REACTIVE_MULTICROSS) != enabled_modes.end())
{
InitializeMode("Solid Reactive Multi Cross", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_SOLID_REACTIVE_NEXUS) != enabled_modes.end())
{
InitializeMode("Solid Reactive Nexus", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_SOLID_REACTIVE_MULTINEXUS) != enabled_modes.end())
{
InitializeMode("Solid Reactive Multi Nexus", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_SPLASH) != enabled_modes.end())
{
InitializeMode("Rainbow Reactive Splash", current_mode, MODE_FLAG_HAS_SPEED, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_MULTISPLASH) != enabled_modes.end())
{
InitializeMode("Rainbow Reactive Multi Splash", current_mode, MODE_FLAG_HAS_SPEED, MODE_COLORS_NONE, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_SOLID_SPLASH) != enabled_modes.end())
{
InitializeMode("Solid Reactive Splash", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_SOLID_MULTISPLASH) != enabled_modes.end())
{
InitializeMode("Solid Reactive Multi Splash", current_mode, MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED, MODE_COLORS_MODE_SPECIFIC, save);
}
if(std::find(enabled_modes.begin(), enabled_modes.end(), QMK_OPENRGB_MODE_OPENRGB_DIRECT) != enabled_modes.end())
{
InitializeMode("Direct", current_mode, MODE_FLAG_HAS_PER_LED_COLOR, MODE_COLORS_PER_LED, save);
}
/*-----------------------------------------------------*\
| As we are insertting direct mode at index 0 |
| for it to be the first mode in the UI there will |
| be a mismatch between the values. QMK has direct |
| mode last in order, while in OpenRGB it's first. |
\*-----------------------------------------------------*/
if(controller->GetMode() == (current_mode - 1))
{
active_mode = 0;
}
else
{
active_mode = controller->GetMode();
}
SetupZones();
}
RGBController_QMKOpenRGBRevD::~RGBController_QMKOpenRGBRevD()
{
for(unsigned int zone_index = 0; zone_index < zones.size(); zone_index++)
{
if(zones[zone_index].matrix_map != NULL)
{
delete zones[zone_index].matrix_map;
}
}
}
void RGBController_QMKOpenRGBRevD::SetupZones()
{
/*---------------------------------------------------------*\
| Get the number of LEDs from the device |
\*---------------------------------------------------------*/
const unsigned int total_number_of_leds = controller->GetTotalNumberOfLEDs();
const unsigned int total_number_of_leds_with_empty_space = controller->GetTotalNumberOfLEDsWithEmptySpace();
/*---------------------------------------------------------*\
| Get information for each LED |
\*---------------------------------------------------------*/
controller->GetLEDInfo(std::max(total_number_of_leds, total_number_of_leds_with_empty_space));
/*---------------------------------------------------------*\
| Get LED vectors from controller |
\*---------------------------------------------------------*/
std::vector<point_t> led_points = controller->GetLEDPoints();
std::vector<unsigned int> led_flags = controller->GetLEDFlags();
std::vector<std::string> led_names = controller->GetLEDNames();
std::vector<unsigned int> led_values = controller->GetLEDValues();
/*---------------------------------------------------------*\
| Count key LEDs and underglow LEDs |
\*---------------------------------------------------------*/
unsigned int number_of_key_leds;
unsigned int number_of_underglow_leds;
CountKeyTypes(led_flags, total_number_of_leds, number_of_key_leds, number_of_underglow_leds);
/*---------------------------------------------------------*\
| Count total LEDs and check if underglow exists |
\*---------------------------------------------------------*/
unsigned int number_of_leds = number_of_key_leds + number_of_underglow_leds;
bool has_underglow = number_of_underglow_leds > 0;
/*---------------------------------------------------------*\
| Create sets for row and column position values |
\*---------------------------------------------------------*/
std::set<int> rows, columns;
for (unsigned int i = 0; i < number_of_leds; i++)
{
rows.insert(led_points[i].y);
columns.insert(led_points[i].x);
}
/*---------------------------------------------------------*\
| Calculate matrix map from QMK positions |
\*---------------------------------------------------------*/
unsigned int divisor = CalculateDivisor(led_points, rows, columns);
VectorMatrix matrix_map;
VectorMatrix underglow_map;
PlaceLEDsInMaps(rows, columns, divisor, led_points, led_flags, matrix_map, underglow_map);
CleanMatrixMaps(matrix_map, underglow_map, rows.size(), has_underglow);
/*---------------------------------------------------------*\
| These vectors are class members because if they go out of |
| scope, the underlying array (used by each zones' |
| matrix_map) is unallocated. |
\*---------------------------------------------------------*/
flat_matrix_map = FlattenMatrixMap(matrix_map);
flat_underglow_map = FlattenMatrixMap(underglow_map);
/*---------------------------------------------------------*\
| Create Keyboard zone |
\*---------------------------------------------------------*/
zone keys_zone;
keys_zone.name = "Keyboard";
keys_zone.type = ZONE_TYPE_MATRIX;
keys_zone.leds_min = number_of_key_leds;
keys_zone.leds_max = keys_zone.leds_min;
keys_zone.leds_count = keys_zone.leds_min;
keys_zone.matrix_map = new matrix_map_type;
keys_zone.matrix_map->width = matrix_map[0].size();
keys_zone.matrix_map->height = matrix_map.size();
keys_zone.matrix_map->map = flat_matrix_map.data();
zones.push_back(keys_zone);
/*---------------------------------------------------------*\
| Create Underglow zone if it exists |
\*---------------------------------------------------------*/
if(has_underglow)
{
zone underglow_zone;
underglow_zone.name = "Underglow";
underglow_zone.type = ZONE_TYPE_MATRIX;
underglow_zone.leds_min = number_of_underglow_leds;
underglow_zone.leds_max = underglow_zone.leds_min;
underglow_zone.leds_count = underglow_zone.leds_min;
underglow_zone.matrix_map = new matrix_map_type;
underglow_zone.matrix_map->width = underglow_map[0].size();
underglow_zone.matrix_map->height = underglow_map.size();
underglow_zone.matrix_map->map = flat_underglow_map.data();
zones.push_back(underglow_zone);
}
/*---------------------------------------------------------*\
| Create LEDs |
\*---------------------------------------------------------*/
for(unsigned int led_idx = 0; led_idx < number_of_leds; led_idx++)
{
led keyboard_led;
if(led_idx < led_names.size())
{
keyboard_led.name = led_names[led_idx];
}
if(led_idx < led_values.size()){
keyboard_led.value = led_values[led_idx];
}
else
{
keyboard_led.value = led_idx;
}
leds.push_back(keyboard_led);
}
/*---------------------------------------------------------*\
| Setup Colors |
\*---------------------------------------------------------*/
SetupColors();
/*---------------------------------------------------------*\
| Initialize colors from device values |
\*---------------------------------------------------------*/
for(unsigned int i = 0; i < leds.size(); i++)
{
colors[i] = controller->GetLEDColors()[i];
}
}
void RGBController_QMKOpenRGBRevD::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_QMKOpenRGBRevD::DeviceUpdateLEDs()
{
controller->DirectModeSetLEDs(colors, controller->GetTotalNumberOfLEDs());
}
void RGBController_QMKOpenRGBRevD::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_QMKOpenRGBRevD::UpdateSingleLED(int led)
{
RGBColor color = colors[led];
unsigned char red = RGBGetRValue(color);
unsigned char grn = RGBGetGValue(color);
unsigned char blu = RGBGetBValue(color);
controller->DirectModeSetSingleLED(led, red, grn, blu);
}
void RGBController_QMKOpenRGBRevD::SetCustomMode()
{
active_mode = 0;
}
void RGBController_QMKOpenRGBRevD::DeviceUpdateMode()
{
if(modes[active_mode].color_mode == MODE_COLORS_PER_LED)
{
controller->SetMode({ 0, 255, 255 }, modes[active_mode].value, 127, false);
}
else if(modes[active_mode].color_mode == MODE_COLORS_NONE)
{
controller->SetMode({ 0, 255, 255 }, modes[active_mode].value, modes[active_mode].speed, false);
}
else if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
{
RGBColor rgb_color = modes[active_mode].colors[0];
hsv_t hsv_color;
rgb2hsv(rgb_color, &hsv_color);
if(modes[active_mode].flags & MODE_FLAG_HAS_SPEED)
{
controller->SetMode(hsv_color, modes[active_mode].value, modes[active_mode].speed, false);
}
else
{
controller->SetMode(hsv_color, modes[active_mode].value, 127, false);
}
}
}
void RGBController_QMKOpenRGBRevD::DeviceSaveMode()
{
if(modes[active_mode].color_mode == MODE_COLORS_NONE)
{
controller->SetMode({ 0, 255, 255 }, modes[active_mode].value, modes[active_mode].speed, true);
}
else if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
{
RGBColor rgb_color = modes[active_mode].colors[0];
hsv_t hsv_color;
rgb2hsv(rgb_color, &hsv_color);
if(modes[active_mode].flags & MODE_FLAG_HAS_SPEED)
{
controller->SetMode(hsv_color, modes[active_mode].value, modes[active_mode].speed, true);
}
else
{
controller->SetMode(hsv_color, modes[active_mode].value, 127, true);
}
}
}
void RGBController_QMKOpenRGBRevD::InitializeMode
(
std::string name,
unsigned int &current_mode,
unsigned int flags,
unsigned int color_mode,
bool save
)
{
mode qmk_mode;
qmk_mode.name = name;
qmk_mode.value = current_mode++;
qmk_mode.flags = flags;
qmk_mode.color_mode = color_mode;
if(flags & MODE_FLAG_HAS_SPEED)
{
qmk_mode.speed_min = QMK_OPENRGB_SPEED_SLOWEST;
qmk_mode.speed_max = QMK_OPENRGB_SPEED_FASTEST;
qmk_mode.speed = QMK_OPENRGB_SPEED_NORMAL;
}
if(flags & MODE_FLAG_HAS_MODE_SPECIFIC_COLOR)
{
qmk_mode.colors_min = 1;
qmk_mode.colors_max = 1;
qmk_mode.colors.resize(1);
qmk_mode.colors[0] = controller->GetModeColor();
}
/*-----------------------------------------------------*\
| Direct mode it the last mode on the QMK firmware |
| but we still want it to appear first on the UI |
\*-----------------------------------------------------*/
if(flags & MODE_FLAG_HAS_PER_LED_COLOR)
{
modes.insert(modes.begin(), qmk_mode);
}
else
{
/*-----------------------------------------------------*\
| Every mode apart from direct is save-able |
\*-----------------------------------------------------*/
if(save == true)
{
qmk_mode.flags = flags | MODE_FLAG_MANUAL_SAVE;
}
modes.push_back(qmk_mode);
}
}
unsigned int RGBController_QMKOpenRGBRevD::CalculateDivisor
(
std::vector<point_t> led_points,
std::set<int> rows,
std::set<int> columns
)
{
std::vector< std::vector<point_t> > row_points(rows.size());
for(const point_t &pt : led_points)
{
for(const int &i : rows)
{
if(pt.y == i)
{
row_points[std::distance(rows.begin(), rows.find(i))].push_back(pt);
}
}
}
int last_pos;
std::vector<int> distances;
for(const std::vector<point_t> &row : row_points)
{
last_pos = 0;
std::for_each(row.begin(), row.end(), [&distances, &last_pos](const point_t &pt)
{
distances.push_back(pt.x - last_pos);
last_pos = pt.x;
});
}
std::map<int, int> counts;
for(const int &i : distances)
{
counts[i]++;
}
unsigned int divisor = distances[0];
for(const std::pair<int, int> &i : counts)
{
if(counts[divisor] < i.second)
{
divisor = i.first;
}
}
return divisor;
}
void RGBController_QMKOpenRGBRevD::CountKeyTypes
(
std::vector<unsigned int> led_flags,
unsigned int total_led_count,
unsigned int& key_leds,
unsigned int& underglow_leds
)
{
underglow_leds = 0;
key_leds = 0;
for(unsigned int i = 0; i < total_led_count; i++)
{
if(led_flags[i] & 2)
{
underglow_leds++;
}
else if(led_flags[i] != 0)
{
key_leds++;
}
}
}
void RGBController_QMKOpenRGBRevD::PlaceLEDsInMaps
(
std::set<int> unique_rows,
std::set<int> unique_cols,
unsigned int divisor,
std::vector<point_t> led_points,
std::vector<unsigned int> led_flags,
VectorMatrix& matrix_map_xl,
VectorMatrix& underglow_map_xl
)
{
matrix_map_xl = MakeEmptyMatrixMap(unique_rows.size(), std::round(255/divisor) + 10);
underglow_map_xl = MakeEmptyMatrixMap(unique_rows.size(), std::round(255/divisor) + 10);
unsigned int x = 0;
unsigned int y = 0;
unsigned int openrgb_idx = 0;
unsigned int underglow_counter = 0;
for(unsigned int i = 0; i < controller->GetTotalNumberOfLEDs(); i++)
{
if(led_points[i].x != 255 && led_points[i].y != 255)
{
bool underglow = led_flags[i] & 2;
x = std::round(led_points[i].x/divisor);
y = std::distance(unique_rows.begin(), unique_rows.find(led_points[i].y));
if(!underglow)
{
while(matrix_map_xl[y][x] != NO_LED)
{
x++;
}
matrix_map_xl[y][x] = i;
}
else
{
while(underglow_map_xl[y][x] != NO_LED)
{
x++;
}
underglow_map_xl[y][x] = underglow_counter;
underglow_counter++;
}
}
}
}
VectorMatrix RGBController_QMKOpenRGBRevD::MakeEmptyMatrixMap
(
unsigned int height,
unsigned int width
)
{
std::vector<std::vector<unsigned int> > matrix_map(height);
for (unsigned int i = 0; i < height; i++)
{
for (unsigned int j = 0; j < width; j++)
{
matrix_map[i].push_back(NO_LED);
}
}
return matrix_map;
}
void RGBController_QMKOpenRGBRevD::CleanMatrixMaps
(
VectorMatrix& matrix_map,
VectorMatrix& underglow_map,
unsigned int height,
bool has_underglow
)
{
bool empty_col = true;
bool empty_col_udg = true;
bool empty_row = true;
int width = 0;
int width_udg = 0;
std::vector<int> empty_rows;
bool can_break;
bool can_break_udg;
for(unsigned int i = 0; i < height; i++)
{
empty_row = true;
can_break = false;
can_break_udg = false;
for(std::size_t j = matrix_map[i].size() - 1; j --> 0; )
{
if(matrix_map[i][j] != NO_LED && width < (j + 1) && !can_break)
{
width = (j + 1);
can_break = true;
empty_row = false;
}
else if(matrix_map[i][j] != NO_LED)
{
empty_row = false;
}
if(underglow_map[i][j] != NO_LED && width_udg < (j + 1) && !can_break_udg)
{
width_udg = (j + 1);
can_break_udg = true;
}
if (can_break && can_break_udg) break;
}
if(matrix_map[i][0] != NO_LED)
{
empty_col = false;
}
if(underglow_map[i][0] != NO_LED)
{
empty_col_udg = false;
}
if(empty_row)
{
empty_rows.push_back(i);
}
}
unsigned int new_height = height - empty_rows.size();
width = empty_col ? width - 1 : width;
width_udg = empty_col_udg && empty_col ? width_udg - 1 : width_udg;
for(unsigned int i = empty_rows.size(); i --> 0; )
{
matrix_map.erase(matrix_map.begin()+empty_rows[i]);
}
for(unsigned int i = 0; i < new_height; i++)
{
if(empty_col)
{
matrix_map[i].erase(matrix_map[i].begin(), matrix_map[i].begin() + 1);
}
if(empty_col_udg && empty_col)
{
underglow_map[i].erase(underglow_map[i].begin(), underglow_map[i].begin() + 1);
}
matrix_map[i].erase(matrix_map[i].begin()+width, matrix_map[i].end());
if(has_underglow)
{
underglow_map[i].erase(underglow_map[i].begin()+width_udg, underglow_map[i].end());
}
}
if(has_underglow)
{
for(unsigned int i = new_height; i < height; i++)
{
underglow_map[i].erase(underglow_map[i].begin()+width_udg, underglow_map[i].end());
}
}
}
std::vector<unsigned int> RGBController_QMKOpenRGBRevD::FlattenMatrixMap
(
VectorMatrix matrix_map
)
{
std::vector<unsigned int> flat_map;
for(const std::vector<unsigned int> &row : matrix_map)
{
for(const unsigned int &item : row)
{
flat_map.push_back(item);
}
}
return flat_map;
}
@@ -0,0 +1,98 @@
/*-------------------------------------------------------------------*\
| RGBController_QMKOpenRGBRevD.h |
| |
| Driver for QMK keyboards using OpenRGB Protocol (Revision D) |
| |
| Kasper 10th Octobber 2020 |
| Jath03 28th May 2021 |
\*-------------------------------------------------------------------*/
#pragma once
#include "RGBController.h"
#include "QMKOpenRGBRevDController.h"
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#define NO_LED 0xFFFFFFFF
typedef std::vector<std::vector<unsigned int>> VectorMatrix;
class RGBController_QMKOpenRGBRevD : public RGBController
{
public:
RGBController_QMKOpenRGBRevD(QMKOpenRGBRevDController* controller_ptr, bool save);
~RGBController_QMKOpenRGBRevD();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
void DeviceSaveMode();
private:
QMKOpenRGBRevDController* controller;
std::vector<unsigned int> flat_matrix_map;
std::vector<unsigned int> flat_underglow_map;
void InitializeMode
(
std::string name,
unsigned int &current_mode,
unsigned int flags,
unsigned int color_mode,
bool save
);
unsigned int CalculateDivisor
(
std::vector<point_t> led_points,
std::set<int> rows,
std::set<int> columns
);
void CountKeyTypes
(
std::vector<unsigned int> led_flags,
unsigned int total_led_count,
unsigned int& key_leds,
unsigned int& underglow_leds
);
void PlaceLEDsInMaps
(
std::set<int> unique_rows,
std::set<int> unique_cols,
unsigned int divisor,
std::vector<point_t> led_points,
std::vector<unsigned int> led_flags,
VectorMatrix& matrix_map_xl,
VectorMatrix& underglow_map_xl
);
VectorMatrix MakeEmptyMatrixMap
(
unsigned int height,
unsigned int width
);
void CleanMatrixMaps
(
VectorMatrix& matrix_map,
VectorMatrix& underglow_map,
unsigned int height,
bool has_underglow
);
std::vector<unsigned int> FlattenMatrixMap
(
VectorMatrix matrix_map
);
};
@@ -49,6 +49,7 @@ RazerController::RazerController(hid_device* dev_handle, hid_device* dev_argb_ha
{
case RAZER_BLACKWIDOW_ELITE_PID:
case RAZER_BLACKWIDOW_2019_PID:
case RAZER_BLACKWIDOW_V3_MINI_WIRED_PID:
case RAZER_CYNOSA_V2_PID:
case RAZER_ORNATA_CHROMA_V2_PID:
case RAZER_TARTARUS_CHROMA_PID:
@@ -61,6 +62,7 @@ RazerController::RazerController(hid_device* dev_handle, hid_device* dev_argb_ha
case RAZER_BASE_STATION_V2_CHROMA_PID:
case RAZER_MOUSE_BUNGEE_V3_CHROMA_PID:
case RAZER_O11_DYNAMIC_PID:
case RAZER_VIPER_8KHZ_PID:
dev_transaction_id = 0x1F;
break;
@@ -77,6 +79,12 @@ RazerController::RazerController(hid_device* dev_handle, hid_device* dev_argb_ha
dev_transaction_id = 0x3F;
}
break;
case RAZER_BLACKWIDOW_V3_MINI_WIRELESS_PID:
{
dev_transaction_id = 0x9F;
break;
}
case RAZER_GOLIATHUS_CHROMA_PID:
case RAZER_GOLIATHUS_CHROMA_EXTENDED_PID:
@@ -125,6 +133,8 @@ RazerController::RazerController(hid_device* dev_handle, hid_device* dev_argb_ha
case RAZER_BLACKWIDOW_V3_PRO_BLUETOOTH_PID:
case RAZER_BLACKWIDOW_V3_PRO_WIRELESS_PID:
case RAZER_BLACKWIDOW_V3_TKL_PID:
case RAZER_BLACKWIDOW_V3_MINI_WIRED_PID:
case RAZER_BLACKWIDOW_V3_MINI_WIRELESS_PID:
case RAZER_CYNOSA_CHROMA_PID:
case RAZER_CYNOSA_LITE_PID:
case RAZER_CYNOSA_V2_PID:
@@ -132,6 +142,9 @@ RazerController::RazerController(hid_device* dev_handle, hid_device* dev_argb_ha
case RAZER_HUNTSMAN_PID:
case RAZER_HUNTSMAN_MINI_PID:
case RAZER_HUNTSMAN_TE_PID:
case RAZER_HUNTSMAN_V2_ANALOG_PID:
case RAZER_HUNTSMAN_V2_TKL_PID:
case RAZER_HUNTSMAN_V2_PID:
case RAZER_ORNATA_CHROMA_PID:
case RAZER_ORNATA_CHROMA_V2_PID:
case RAZER_CORE_PID:
@@ -203,6 +216,8 @@ RazerController::RazerController(hid_device* dev_handle, hid_device* dev_argb_ha
case RAZER_BLACKWIDOW_V3_PRO_BLUETOOTH_PID:
case RAZER_BLACKWIDOW_V3_PRO_WIRELESS_PID:
case RAZER_BLACKWIDOW_V3_TKL_PID:
case RAZER_BLACKWIDOW_V3_MINI_WIRED_PID:
case RAZER_BLACKWIDOW_V3_MINI_WIRELESS_PID:
case RAZER_CHARGING_PAD_CHROMA_PID:
case RAZER_CHROMA_HDK_PID:
case RAZER_CHROMA_PC_CASE_LIGHTING_KIT_PID:
@@ -224,6 +239,9 @@ RazerController::RazerController(hid_device* dev_handle, hid_device* dev_argb_ha
case RAZER_HUNTSMAN_PID:
case RAZER_HUNTSMAN_MINI_PID:
case RAZER_HUNTSMAN_TE_PID:
case RAZER_HUNTSMAN_V2_ANALOG_PID:
case RAZER_HUNTSMAN_V2_TKL_PID:
case RAZER_HUNTSMAN_V2_PID:
case RAZER_KRAKEN_KITTY_EDITION_PID:
case RAZER_LANCEHEAD_TE_WIRED_PID:
case RAZER_LANCEHEAD_2017_WIRED_PID:
@@ -245,6 +263,7 @@ RazerController::RazerController(hid_device* dev_handle, hid_device* dev_argb_ha
case RAZER_SEIREN_EMOTE_PID:
case RAZER_TARTARUS_V2_PID:
case RAZER_TIAMAT_71_V2_PID:
case RAZER_VIPER_8KHZ_PID:
case RAZER_VIPER_MINI_PID:
case RAZER_VIPER_PID:
case RAZER_VIPER_ULTIMATE_WIRED_PID:
@@ -444,6 +463,8 @@ bool RazerController::SupportsWave()
case RAZER_BLACKWIDOW_V3_PRO_BLUETOOTH_PID:
case RAZER_BLACKWIDOW_V3_PRO_WIRELESS_PID:
case RAZER_BLACKWIDOW_V3_TKL_PID:
case RAZER_BLACKWIDOW_V3_MINI_WIRED_PID:
case RAZER_BLACKWIDOW_V3_MINI_WIRELESS_PID:
case RAZER_BLACKWIDOW_X_CHROMA_PID:
case RAZER_BLACKWIDOW_X_CHROMA_TE_PID:
case RAZER_BLADE_2016_PID:
@@ -481,6 +502,9 @@ bool RazerController::SupportsWave()
case RAZER_HUNTSMAN_ELITE_PID:
case RAZER_HUNTSMAN_MINI_PID:
case RAZER_HUNTSMAN_TE_PID:
case RAZER_HUNTSMAN_V2_ANALOG_PID:
case RAZER_HUNTSMAN_V2_TKL_PID:
case RAZER_HUNTSMAN_V2_PID:
case RAZER_ORBWEAVER_CHROMA_PID:
case RAZER_TARTARUS_V2_PID:
@@ -10,6 +10,8 @@
#include "RGBController_RazerKraken.h"
#include <hidapi/hidapi.h>
#include <unordered_set>
static bool openrazer_checked = false;
static bool openrazer_enabled = false;
@@ -88,6 +90,21 @@ void DetectRazerControllers(hid_device_info* info, const std::string& name)
* *
\******************************************************************************************/
/*---------------------------------------------------------------------*\
| Tracks the paths used in DetectRazerARGBControllers so multiple Razer |
| devices can be detected without all controlling the same device. |
\*---------------------------------------------------------------------*/
static std::unordered_set<std::string> used_paths;
/*--------------------------------------------------------------------------------*\
| Removes all entries in used_paths so device discovery does not skip any of them. |
\*--------------------------------------------------------------------------------*/
void ResetRazerARGBControllersPaths()
{
used_paths.clear();
}
void DetectRazerARGBControllers(hid_device_info* info, const std::string& name)
{
/*-------------------------------------------------------------------------------------------------*\
@@ -102,19 +119,31 @@ void DetectRazerARGBControllers(hid_device_info* info, const std::string& name)
hid_device* dev_interface_1 = nullptr;
hid_device_info* info_full = hid_enumerate(RAZER_VID, RAZER_CHROMA_ADDRESSABLE_RGB_CONTROLLER_PID);
hid_device_info* info_temp = info_full;
/*--------------------------------------------------------------------------------------------*\
| Keep track of paths so they can be added to used_paths only if both interfaces can be found. |
\*--------------------------------------------------------------------------------------------*/
std::string dev_interface_0_path;
std::string dev_interface_1_path;
while(info_temp)
{
if(info_temp->vendor_id == info->vendor_id
&& info_temp->product_id == info->product_id )
/*----------------------------------------------------------------------------*\
| Check for paths used on an already registered Razer ARGB controller to avoid |
| registering multiple controllers that refer to the same physical hardware. |
\*----------------------------------------------------------------------------*/
if(info_temp->vendor_id == info->vendor_id
&& info_temp->product_id == info->product_id
&& used_paths.find(info_temp->path) == used_paths.end() )
{
if(info_temp->interface_number == 0)
{
dev_interface_0 = hid_open_path(info_temp->path);
dev_interface_0 = hid_open_path(info_temp->path);
dev_interface_0_path = info_temp->path;
}
else if(info_temp->interface_number == 1)
{
dev_interface_1 = hid_open_path(info_temp->path);
dev_interface_1_path = info_temp->path;
}
}
if(dev_interface_0 && dev_interface_1)
@@ -131,6 +160,8 @@ void DetectRazerARGBControllers(hid_device_info* info, const std::string& name)
RazerController* controller = new RazerController(dev_interface_0, dev_interface_1, info->path, info->product_id, name);
RGBController_RazerAddressable* rgb_controller = new RGBController_RazerAddressable(controller);
ResourceManager::get()->RegisterRGBController(rgb_controller);
used_paths.insert(dev_interface_0_path);
used_paths.insert(dev_interface_1_path);
}
else
{
@@ -220,7 +251,9 @@ REGISTER_HID_DETECTOR_IPU("Razer Blackwidow V3", Det
REGISTER_HID_DETECTOR_IPU("Razer Blackwidow V3 Pro (Wired)", DetectRazerControllers, RAZER_VID, RAZER_BLACKWIDOW_V3_PRO_WIRED_PID, 0x02, 0x01, 0x02);
// REGISTER_HID_DETECTOR_PU ("Razer Blackwidow V3 Pro (Bluetooth)", DetectRazerControllers, RAZER_VID, RAZER_BLACKWIDOW_V3_PRO_BLUETOOTH_PID, 0x01, 0x00);
REGISTER_HID_DETECTOR_IPU("Razer Blackwidow V3 Pro (Wireless)", DetectRazerControllers, RAZER_VID, RAZER_BLACKWIDOW_V3_PRO_WIRELESS_PID, 0x03, 0x0C, 0x01);
REGISTER_HID_DETECTOR_IPU("Razer Blackwidow V3 TKL", DetectRazerControllers, RAZER_VID, RAZER_BLACKWIDOW_V3_TKL_PID, 0x00, 0x01, 0x02);
REGISTER_HID_DETECTOR_IPU("Razer Blackwidow V3 TKL", DetectRazerControllers, RAZER_VID, RAZER_BLACKWIDOW_V3_TKL_PID, 0x02, 0x01, 0x02);
REGISTER_HID_DETECTOR_IPU("Razer Blackwidow V3 Mini (Wired)", DetectRazerControllers, RAZER_VID, RAZER_BLACKWIDOW_V3_MINI_WIRED_PID, 0x03, 0x0C, 0x01);
REGISTER_HID_DETECTOR_IPU("Razer Blackwidow V3 Mini (Wireless)", DetectRazerControllers, RAZER_VID, RAZER_BLACKWIDOW_V3_MINI_WIRELESS_PID, 0x03, 0x0C, 0x01);
REGISTER_HID_DETECTOR_IPU("Razer Blackwidow X Chroma", DetectRazerControllers, RAZER_VID, RAZER_BLACKWIDOW_X_CHROMA_PID, 0x02, 0x01, 0x02);
REGISTER_HID_DETECTOR_IPU("Razer Blackwidow X Chroma Tournament Edition", DetectRazerControllers, RAZER_VID, RAZER_BLACKWIDOW_X_CHROMA_TE_PID, 0x02, 0x01, 0x02);
REGISTER_HID_DETECTOR_IPU("Razer Cynosa Chroma", DetectRazerControllers, RAZER_VID, RAZER_CYNOSA_CHROMA_PID, 0x02, 0x01, 0x02);
@@ -231,6 +264,9 @@ REGISTER_HID_DETECTOR_IPU("Razer Huntsman", Det
REGISTER_HID_DETECTOR_IPU("Razer Huntsman Elite", DetectRazerControllers, RAZER_VID, RAZER_HUNTSMAN_ELITE_PID, 0x02, 0x01, 0x02);
REGISTER_HID_DETECTOR_IPU("Razer Huntsman Mini", DetectRazerControllers, RAZER_VID, RAZER_HUNTSMAN_MINI_PID, 0x02, 0x01, 0x02);
REGISTER_HID_DETECTOR_IPU("Razer Huntsman Tournament Edition", DetectRazerControllers, RAZER_VID, RAZER_HUNTSMAN_TE_PID, 0x02, 0x01, 0x02);
REGISTER_HID_DETECTOR_IPU("Razer Huntsman V2 Analog", DetectRazerControllers, RAZER_VID, RAZER_HUNTSMAN_V2_ANALOG_PID, 0x03, 0x0C, 0x01);
REGISTER_HID_DETECTOR_IPU("Razer Huntsman V2 TKL", DetectRazerControllers, RAZER_VID, RAZER_HUNTSMAN_V2_TKL_PID, 0x03, 0x0C, 0x01);
REGISTER_HID_DETECTOR_IPU("Razer Huntsman V2", DetectRazerControllers, RAZER_VID, RAZER_HUNTSMAN_V2_PID, 0x03, 0x0C, 0x01);
REGISTER_HID_DETECTOR_IPU("Razer Ornata Chroma", DetectRazerControllers, RAZER_VID, RAZER_ORNATA_CHROMA_PID, 0x02, 0x01, 0x02);
REGISTER_HID_DETECTOR_IPU("Razer Ornata Chroma V2", DetectRazerControllers, RAZER_VID, RAZER_ORNATA_CHROMA_V2_PID, 0x02, 0x01, 0x02);
@@ -306,6 +342,7 @@ REGISTER_HID_DETECTOR_IPU("Razer Naga Left Handed", Det
REGISTER_HID_DETECTOR_IPU("Razer Naga Hex V2", DetectRazerControllers, RAZER_VID, RAZER_NAGA_HEX_V2_PID, 0x00, 0x01, 0x02);
REGISTER_HID_DETECTOR_IPU("Razer Naga Trinity", DetectRazerControllers, RAZER_VID, RAZER_NAGA_TRINITY_PID, 0x00, 0x01, 0x02);
REGISTER_HID_DETECTOR_IPU("Razer Viper", DetectRazerControllers, RAZER_VID, RAZER_VIPER_PID, 0x00, 0x01, 0x02);
REGISTER_HID_DETECTOR_IPU("Razer Viper 8kHz", DetectRazerControllers, RAZER_VID, RAZER_VIPER_8KHZ_PID, 0x00, 0x01, 0x02);
REGISTER_HID_DETECTOR_IPU("Razer Viper Mini", DetectRazerControllers, RAZER_VID, RAZER_VIPER_MINI_PID, 0x00, 0x01, 0x02);
REGISTER_HID_DETECTOR_IPU("Razer Viper Ultimate (Wired)", DetectRazerControllers, RAZER_VID, RAZER_VIPER_ULTIMATE_WIRED_PID, 0x00, 0x01, 0x02);
REGISTER_HID_DETECTOR_IPU("Razer Viper Ultimate (Wireless)", DetectRazerControllers, RAZER_VID, RAZER_VIPER_ULTIMATE_WIRELESS_PID, 0x00, 0x01, 0x02);
@@ -324,7 +361,8 @@ REGISTER_HID_DETECTOR_IPU("Razer Kraken 7.1", Det
REGISTER_HID_DETECTOR_IPU("Razer Kraken 7.1", DetectRazerKrakenControllers, RAZER_VID, RAZER_KRAKEN_CLASSIC_ALT_PID, 0x03, 0x0C, 0x01);
REGISTER_HID_DETECTOR_IPU("Razer Kraken 7.1 Chroma", DetectRazerKrakenControllers, RAZER_VID, RAZER_KRAKEN_PID, 0x03, 0x0C, 0x01);
REGISTER_HID_DETECTOR_IPU("Razer Kraken 7.1 V2", DetectRazerKrakenControllers, RAZER_VID, RAZER_KRAKEN_V2_PID, 0x03, 0x0C, 0x01);
REGISTER_HID_DETECTOR_IPU("Razer Kraken Kitty Edition", DetectRazerControllers, RAZER_VID, RAZER_KRAKEN_KITTY_EDITION_PID, 0x00, 0x01, 0x03);
REGISTER_HID_DETECTOR_IPU("Razer Kraken Kitty Edition", DetectRazerControllers, RAZER_VID, RAZER_KRAKEN_KITTY_EDITION_PID, 0x01, 0x01, 0x03);
REGISTER_HID_DETECTOR_IPU("Razer Kraken Kitty Black Edition", DetectRazerControllers, RAZER_VID, RAZER_KRAKEN_KITTY_BLACK_EDITION_PID, 0x01, 0x01, 0x03);
REGISTER_HID_DETECTOR_IPU("Razer Kraken Ultimate", DetectRazerKrakenControllers, RAZER_VID, RAZER_KRAKEN_ULTIMATE_PID, 0x03, 0x0C, 0x01);
REGISTER_HID_DETECTOR_I( "Razer Tiamat 7.1 V2", DetectRazerControllers, RAZER_VID, RAZER_TIAMAT_71_V2_PID, 0x00 );
@@ -344,6 +382,7 @@ REGISTER_HID_DETECTOR_IPU("Razer Base Station Chroma", Det
REGISTER_HID_DETECTOR_IPU("Razer Base Station V2 Chroma", DetectRazerControllers, RAZER_VID, RAZER_BASE_STATION_V2_CHROMA_PID, 0x00, 0x01, 0x02);
REGISTER_HID_DETECTOR_IPU("Razer Charging Pad Chroma", DetectRazerControllers, RAZER_VID, RAZER_CHARGING_PAD_CHROMA_PID, 0x00, 0x0C, 0x01);
REGISTER_HID_DETECTOR_I ("Razer Chroma Addressable RGB Controller", DetectRazerARGBControllers, RAZER_VID, RAZER_CHROMA_ADDRESSABLE_RGB_CONTROLLER_PID, 0x00 );
REGISTER_DYNAMIC_DETECTOR("Razer Chrome Addressable RGB Controller Setup", ResetRazerARGBControllersPaths );
REGISTER_HID_DETECTOR_IPU("Razer Chroma HDK", DetectRazerControllers, RAZER_VID, RAZER_CHROMA_HDK_PID, 0x02, 0x01, 0x02);
REGISTER_HID_DETECTOR_IPU("Razer Chroma Mug Holder", DetectRazerControllers, RAZER_VID, RAZER_CHROMA_MUG_PID, 0x00, 0x01, 0x02);
REGISTER_HID_DETECTOR_IPU("Razer Chroma PC Case Lighting Kit", DetectRazerControllers, RAZER_VID, RAZER_CHROMA_PC_CASE_LIGHTING_KIT_PID, 0x02, 0x01, 0x02);
+734 -2
View File
@@ -22,6 +22,8 @@
#define RAZER_BLACKWIDOW_LITE_PID 0x0235
#define RAZER_BLACKWIDOW_OVERWATCH_PID 0x0211
#define RAZER_BLACKWIDOW_V3_PID 0x024E
#define RAZER_BLACKWIDOW_V3_MINI_WIRED_PID 0x0258
#define RAZER_BLACKWIDOW_V3_MINI_WIRELESS_PID 0x0271
#define RAZER_BLACKWIDOW_V3_PRO_WIRED_PID 0x025A
#define RAZER_BLACKWIDOW_V3_PRO_BLUETOOTH_PID 0x025B
#define RAZER_BLACKWIDOW_V3_PRO_WIRELESS_PID 0x025C
@@ -72,6 +74,9 @@
#define RAZER_HUNTSMAN_PID 0x0227
#define RAZER_HUNTSMAN_MINI_PID 0x0257
#define RAZER_HUNTSMAN_TE_PID 0x0243
#define RAZER_HUNTSMAN_V2_ANALOG_PID 0x0266
#define RAZER_HUNTSMAN_V2_TKL_PID 0x026B
#define RAZER_HUNTSMAN_V2_PID 0x026C
#define RAZER_ORBWEAVER_CHROMA_PID 0x0207
#define RAZER_ORNATA_CHROMA_PID 0x021E
#define RAZER_ORNATA_CHROMA_V2_PID 0x025D
@@ -138,6 +143,7 @@
#define RAZER_OROCHI_CHROMA_PID 0x0048
#define RAZER_OUROBOROS_PID 0x0032
#define RAZER_TAIPAN_PID 0x0034
#define RAZER_VIPER_8KHZ_PID 0x0091
#define RAZER_VIPER_MINI_PID 0x008A
#define RAZER_VIPER_PID 0x0078
#define RAZER_VIPER_ULTIMATE_WIRED_PID 0x007A
@@ -149,6 +155,7 @@
#define RAZER_KRAKEN_CLASSIC_ALT_PID 0x0506
#define RAZER_KRAKEN_CLASSIC_PID 0x0501
#define RAZER_KRAKEN_KITTY_EDITION_PID 0x0F19
#define RAZER_KRAKEN_KITTY_BLACK_EDITION_PID 0x0F21
#define RAZER_KRAKEN_PID 0x0504
#define RAZER_KRAKEN_ULTIMATE_PID 0x0527
#define RAZER_KRAKEN_V2_PID 0x0510
@@ -523,6 +530,86 @@ static const razer_key blackwidow_v3_tkl_keymap[] =
{ 0, 5, 17, "Key: Right Arrow" },
};
#define BLACKWIDOW_V3_MINI_KEYMAP_SIZE (sizeof(blackwidow_v3_mini_keymap) / sizeof(blackwidow_v3_mini_keymap[0]))
static const razer_key blackwidow_v3_mini_keymap[] =
{
/*---------------------------------------------------------------------*\
| Zone, Row, Column, Key |
\*---------------------------------------------------------------------*/
{ 0, 0, 0, "Key: Escape" },
{ 0, 0, 1, "Key: 1" },
{ 0, 0, 2, "Key: 2" },
{ 0, 0, 3, "Key: 3" },
{ 0, 0, 4, "Key: 4" },
{ 0, 0, 5, "Key: 5" },
{ 0, 0, 6, "Key: 6" },
{ 0, 0, 7, "Key: 7" },
{ 0, 0, 8, "Key: 8" },
{ 0, 0, 9, "Key: 9" },
{ 0, 0, 10, "Key: 0" },
{ 0, 0, 11, "Key: -" },
{ 0, 0, 12, "Key: =" },
{ 0, 0, 14, "Key: Backspace" },
{ 0, 0, 15, "Key: Delete" },
{ 0, 1, 0, "Key: Tab" },
{ 0, 1, 1, "Key: Q" },
{ 0, 1, 2, "Key: W" },
{ 0, 1, 3, "Key: E" },
{ 0, 1, 4, "Key: R" },
{ 0, 1, 5, "Key: T" },
{ 0, 1, 6, "Key: Y" },
{ 0, 1, 7, "Key: U" },
{ 0, 1, 8, "Key: I" },
{ 0, 1, 9, "Key: O" },
{ 0, 1, 10, "Key: P" },
{ 0, 1, 11, "Key: [" },
{ 0, 1, 12, "Key: ]" },
{ 0, 1, 13, "Key: \\ (ANSI)" },
{ 0, 1, 15, "Key: Page Up" },
{ 0, 2, 0, "Key: Caps Lock" },
{ 0, 2, 1, "Key: A" },
{ 0, 2, 2, "Key: S" },
{ 0, 2, 3, "Key: D" },
{ 0, 2, 4, "Key: F" },
{ 0, 2, 5, "Key: G" },
{ 0, 2, 6, "Key: H" },
{ 0, 2, 7, "Key: J" },
{ 0, 2, 8, "Key: K" },
{ 0, 2, 9, "Key: L" },
{ 0, 2, 10, "Key: ;" },
{ 0, 2, 11, "Key: '" },
{ 0, 2, 12, "Key: #" },
{ 0, 2, 13, "Key: Enter" },
{ 0, 2, 15, "Key: Page Down" },
{ 0, 3, 0, "Key: Left Shift" },
{ 0, 3, 1, "Key: \\ (ISO)" },
{ 0, 3, 2, "Key: Z" },
{ 0, 3, 3, "Key: X" },
{ 0, 3, 4, "Key: C" },
{ 0, 3, 5, "Key: V" },
{ 0, 3, 6, "Key: B" },
{ 0, 3, 7, "Key: N" },
{ 0, 3, 8, "Key: M" },
{ 0, 3, 9, "Key: ," },
{ 0, 3, 10, "Key: ." },
{ 0, 3, 11, "Key: /" },
{ 0, 3, 13, "Key: Right Shift" },
{ 0, 3, 14, "Key: Up Arrow" },
{ 0, 3, 15, "Key: Insert" },
{ 0, 4, 0, "Key: Left Control" },
{ 0, 4, 1, "Key: Left Windows" },
{ 0, 4, 2, "Key: Left Alt" },
{ 0, 4, 6, "Key: Space" },
{ 0, 4, 7, "Logo" },
{ 0, 4, 10, "Key: Right Alt" },
{ 0, 4, 11, "Key: Right Fn" },
{ 0, 4, 12, "Key: Right Control" },
{ 0, 4, 13, "Key: Left Arrow" },
{ 0, 4, 14, "Key: Down Arrow" },
{ 0, 4, 15, "Key: Right Arrow" },
};
#define BOOK_13_2020_KEYMAP_SIZE (sizeof(book_13_2020_keymap) / sizeof(book_13_2020_keymap[0]))
static const razer_key book_13_2020_keymap[] =
@@ -697,6 +784,96 @@ static const razer_key blade_14_2021_keymap[] =
{ 0, 5, 15, "Key: Down Arrow" },
};
#define BLADE_17_PRO_2021_KEYMAP_SIZE (sizeof(blade_17_pro_2021_keymap) / sizeof(blade_17_pro_2021_keymap[0]))
static const razer_key blade_17_pro_2021_keymap[] =
{
/*---------------------------------------------------------------------*\
| Zone, Row, Column, Key |
\*---------------------------------------------------------------------*/
{ 0, 0, 1, "Key: Escape" },
{ 0, 0, 2, "Key: F1" },
{ 0, 0, 3, "Key: F2" },
{ 0, 0, 4, "Key: F3" },
{ 0, 0, 5, "Key: F4" },
{ 0, 0, 6, "Key: F5" },
{ 0, 0, 7, "Key: F6" },
{ 0, 0, 8, "Key: F7" },
{ 0, 0, 9, "Key: F8" },
{ 0, 0, 10, "Key: F9" },
{ 0, 0, 11, "Key: F10" },
{ 0, 0, 12, "Key: F11" },
{ 0, 0, 13, "Key: F12" },
{ 0, 0, 14, "Key: Insert" },
{ 0, 0, 15, "Key: Delete" },
{ 0, 1, 1, "Key: `" },
{ 0, 1, 2, "Key: 1" },
{ 0, 1, 3, "Key: 2" },
{ 0, 1, 4, "Key: 3" },
{ 0, 1, 5, "Key: 4" },
{ 0, 1, 6, "Key: 5" },
{ 0, 1, 7, "Key: 6" },
{ 0, 1, 8, "Key: 7" },
{ 0, 1, 9, "Key: 8" },
{ 0, 1, 10, "Key: 9" },
{ 0, 1, 11, "Key: 0" },
{ 0, 1, 12, "Key: -" },
{ 0, 1, 13, "Key: =" },
{ 0, 1, 15, "Key: Backspace" },
{ 0, 2, 1, "Key: Tab" },
{ 0, 2, 2, "Key: Q" },
{ 0, 2, 3, "Key: W" },
{ 0, 2, 4, "Key: E" },
{ 0, 2, 5, "Key: R" },
{ 0, 2, 6, "Key: T" },
{ 0, 2, 7, "Key: Y" },
{ 0, 2, 8, "Key: U" },
{ 0, 2, 9, "Key: I" },
{ 0, 2, 10, "Key: O" },
{ 0, 2, 11, "Key: P" },
{ 0, 2, 12, "Key: [" },
{ 0, 2, 13, "Key: ]" },
{ 0, 2, 14, "Key: Enter" },
{ 0, 2, 15, "Key: \\ (ANSI)" },
{ 0, 3, 1, "Key: Caps Lock" },
{ 0, 3, 2, "Key: A" },
{ 0, 3, 3, "Key: S" },
{ 0, 3, 4, "Key: D" },
{ 0, 3, 5, "Key: F" },
{ 0, 3, 6, "Key: G" },
{ 0, 3, 7, "Key: H" },
{ 0, 3, 8, "Key: J" },
{ 0, 3, 9, "Key: K" },
{ 0, 3, 10, "Key: L" },
{ 0, 3, 11, "Key: ;" },
{ 0, 3, 12, "Key: '" },
{ 0, 3, 13, "Key: #" },
{ 0, 4, 1, "Key: Left Shift" },
{ 0, 4, 2, "Key: \\ (ISO)" },
{ 0, 4, 3, "Key: Z" },
{ 0, 4, 4, "Key: X" },
{ 0, 4, 5, "Key: C" },
{ 0, 4, 6, "Key: V" },
{ 0, 4, 7, "Key: B" },
{ 0, 4, 8, "Key: N" },
{ 0, 4, 9, "Key: M" },
{ 0, 4, 10, "Key: ," },
{ 0, 4, 11, "Key: ." },
{ 0, 4, 12, "Key: /" },
{ 0, 4, 15, "Key: Right Shift" },
{ 0, 5, 1, "Key: Left Control" },
{ 0, 5, 2, "Key: Left Fn" },
{ 0, 5, 3, "Key: Left Windows" },
{ 0, 5, 5, "Key: Left Alt" },
{ 0, 5, 9, "Key: Right Alt" },
{ 0, 5, 10, "Key: Right Fn" },
{ 0, 5, 11, "Key: Right Control" },
{ 0, 5, 12, "Key: Left Arrow" },
{ 0, 5, 13, "Key: Up Arrow" },
{ 0, 5, 14, "Key: Right Arrow" },
{ 0, 5, 15, "Key: Down Arrow" },
};
#define BLADE_PRO_2017_KEYMAP_SIZE (sizeof(blade_pro_2017_keymap) / sizeof(blade_pro_2017_keymap[0]))
static const razer_key blade_pro_2017_keymap[] =
@@ -1122,6 +1299,125 @@ static const razer_key huntsman_elite_keymap[] =
{ 0, 5, 20, "Key: Number Pad ." },
};
#define HUNTSMAN_V2_ANALOG_KEYMAP_SIZE (sizeof(huntsman_v2_analog_keymap) / sizeof(huntsman_v2_analog_keymap[0]))
static const razer_key huntsman_v2_analog_keymap[] =
{
/*---------------------------------------------------------------------*\
| Zone, Row, Column, Key |
\*---------------------------------------------------------------------*/
{ 0, 0, 1, "Key: Escape" },
{ 0, 0, 3, "Key: F1" },
{ 0, 0, 4, "Key: F2" },
{ 0, 0, 5, "Key: F3" },
{ 0, 0, 6, "Key: F4" },
{ 0, 0, 7, "Key: F5" },
{ 0, 0, 8, "Key: F6" },
{ 0, 0, 9, "Key: F7" },
{ 0, 0, 10, "Key: F8" },
{ 0, 0, 11, "Key: F9" },
{ 0, 0, 12, "Key: F10" },
{ 0, 0, 13, "Key: F11" },
{ 0, 0, 14, "Key: F12" },
{ 0, 0, 15, "Key: Print Screen" },
{ 0, 0, 16, "Key: Scroll Lock" },
{ 0, 0, 17, "Key: Pause/Break" },
{ 0, 0, 18, "Key: Media Previous" },
{ 0, 0, 19, "Key: Media Play/Pause" },
{ 0, 0, 20, "Key: Media Next" },
{ 0, 0, 21, "Key: Media Mute" },
{ 0, 1, 1, "Key: `" },
{ 0, 1, 2, "Key: 1" },
{ 0, 1, 3, "Key: 2" },
{ 0, 1, 4, "Key: 3" },
{ 0, 1, 5, "Key: 4" },
{ 0, 1, 6, "Key: 5" },
{ 0, 1, 7, "Key: 6" },
{ 0, 1, 8, "Key: 7" },
{ 0, 1, 9, "Key: 8" },
{ 0, 1, 10, "Key: 9" },
{ 0, 1, 11, "Key: 0" },
{ 0, 1, 12, "Key: -" },
{ 0, 1, 13, "Key: =" },
{ 0, 1, 14, "Key: Backspace" },
{ 0, 1, 15, "Key: Insert" },
{ 0, 1, 16, "Key: Home" },
{ 0, 1, 17, "Key: Page Up" },
{ 0, 1, 18, "Key: Num Lock" },
{ 0, 1, 19, "Key: Number Pad /" },
{ 0, 1, 20, "Key: Number Pad *" },
{ 0, 1, 21, "Key: Number Pad -" },
{ 0, 2, 1, "Key: Tab" },
{ 0, 2, 2, "Key: Q" },
{ 0, 2, 3, "Key: W" },
{ 0, 2, 4, "Key: E" },
{ 0, 2, 5, "Key: R" },
{ 0, 2, 6, "Key: T" },
{ 0, 2, 7, "Key: Y" },
{ 0, 2, 8, "Key: U" },
{ 0, 2, 9, "Key: I" },
{ 0, 2, 10, "Key: O" },
{ 0, 2, 11, "Key: P" },
{ 0, 2, 12, "Key: [" },
{ 0, 2, 13, "Key: ]" },
{ 0, 2, 14, "Key: \\ (ANSI)" },
{ 0, 2, 15, "Key: Delete" },
{ 0, 2, 16, "Key: End" },
{ 0, 2, 17, "Key: Page Down" },
{ 0, 2, 18, "Key: Number Pad 7" },
{ 0, 2, 19, "Key: Number Pad 8" },
{ 0, 2, 20, "Key: Number Pad 9" },
{ 0, 2, 21, "Key: Number Pad +" },
{ 0, 3, 1, "Key: Caps Lock" },
{ 0, 3, 2, "Key: A" },
{ 0, 3, 3, "Key: S" },
{ 0, 3, 4, "Key: D" },
{ 0, 3, 5, "Key: F" },
{ 0, 3, 6, "Key: G" },
{ 0, 3, 7, "Key: H" },
{ 0, 3, 8, "Key: J" },
{ 0, 3, 9, "Key: K" },
{ 0, 3, 10, "Key: L" },
{ 0, 3, 11, "Key: ;" },
{ 0, 3, 12, "Key: '" },
{ 0, 3, 13, "Key: #" },
{ 0, 3, 14, "Key: Enter" },
{ 0, 3, 18, "Key: Number Pad 4" },
{ 0, 3, 19, "Key: Number Pad 5" },
{ 0, 3, 20, "Key: Number Pad 6" },
{ 0, 4, 1, "Key: Left Shift" },
{ 0, 4, 2, "Key: \\ (ISO)" },
{ 0, 4, 3, "Key: Z" },
{ 0, 4, 4, "Key: X" },
{ 0, 4, 5, "Key: C" },
{ 0, 4, 6, "Key: V" },
{ 0, 4, 7, "Key: B" },
{ 0, 4, 8, "Key: N" },
{ 0, 4, 9, "Key: M" },
{ 0, 4, 10, "Key: ," },
{ 0, 4, 11, "Key: ." },
{ 0, 4, 12, "Key: /" },
{ 0, 4, 14, "Key: Right Shift" },
{ 0, 4, 16, "Key: Up Arrow" },
{ 0, 4, 18, "Key: Number Pad 1" },
{ 0, 4, 19, "Key: Number Pad 2" },
{ 0, 4, 20, "Key: Number Pad 3" },
{ 0, 4, 21, "Key: Number Pad Enter" },
{ 0, 5, 1, "Key: Left Control" },
{ 0, 5, 2, "Key: Left Windows" },
{ 0, 5, 3, "Key: Left Alt" },
{ 0, 5, 7, "Key: Space" },
{ 0, 5, 11, "Key: Right Alt" },
{ 0, 5, 12, "Key: Right Fn" },
{ 0, 5, 13, "Key: Menu" },
{ 0, 5, 14, "Key: Right Control" },
{ 0, 5, 15, "Key: Left Arrow" },
{ 0, 5, 16, "Key: Down Arrow" },
{ 0, 5, 17, "Key: Right Arrow" },
{ 0, 5, 19, "Key: Number Pad 0" },
{ 0, 5, 20, "Key: Number Pad ." },
};
#define HUNTSMAN_KEYMAP_SIZE (sizeof(huntsman_keymap) / sizeof(huntsman_keymap[0]))
static const razer_key huntsman_keymap[] =
@@ -1407,6 +1703,223 @@ static const razer_key huntsman_te_keymap[] =
{ 0, 5, 17, "Key: Right Arrow" },
};
#define HUNTSMAN_V2_KEYMAP_SIZE (sizeof(huntsman_v2_keymap) / sizeof(huntsman_v2_keymap[0]))
static const razer_key huntsman_v2_keymap[] =
{
/*---------------------------------------------------------------------*\
| Zone, Row, Column, Key |
\*---------------------------------------------------------------------*/
{ 0, 0, 0, "Key: Escape" },
{ 0, 0, 2, "Key: F1" },
{ 0, 0, 3, "Key: F2" },
{ 0, 0, 4, "Key: F3" },
{ 0, 0, 5, "Key: F4" },
{ 0, 0, 6, "Key: F5" },
{ 0, 0, 7, "Key: F6" },
{ 0, 0, 8, "Key: F7" },
{ 0, 0, 9, "Key: F8" },
{ 0, 0, 10, "Key: F9" },
{ 0, 0, 11, "Key: F10" },
{ 0, 0, 12, "Key: F11" },
{ 0, 0, 13, "Key: F12" },
{ 0, 0, 14, "Key: Print Screen" },
{ 0, 0, 15, "Key: Scroll Lock" },
{ 0, 0, 16, "Key: Pause/Break" },
{ 0, 0, 17, "Key: Media Previous" },
{ 0, 0, 18, "Key: Media Play/Pause" },
{ 0, 0, 19, "Key: Media Next" },
{ 0, 0, 20, "Key: Media Mute" },
{ 0, 1, 0, "Key: `" },
{ 0, 1, 1, "Key: 1" },
{ 0, 1, 2, "Key: 2" },
{ 0, 1, 3, "Key: 3" },
{ 0, 1, 4, "Key: 4" },
{ 0, 1, 5, "Key: 5" },
{ 0, 1, 6, "Key: 6" },
{ 0, 1, 7, "Key: 7" },
{ 0, 1, 8, "Key: 8" },
{ 0, 1, 9, "Key: 9" },
{ 0, 1, 10, "Key: 0" },
{ 0, 1, 11, "Key: -" },
{ 0, 1, 12, "Key: =" },
{ 0, 1, 13, "Key: Backspace" },
{ 0, 1, 14, "Key: Insert" },
{ 0, 1, 15, "Key: Home" },
{ 0, 1, 16, "Key: Page Up" },
{ 0, 1, 17, "Key: Num Lock" },
{ 0, 1, 18, "Key: Number Pad /" },
{ 0, 1, 19, "Key: Number Pad *" },
{ 0, 1, 20, "Key: Number Pad -" },
{ 0, 2, 0, "Key: Tab" },
{ 0, 2, 1, "Key: Q" },
{ 0, 2, 2, "Key: W" },
{ 0, 2, 3, "Key: E" },
{ 0, 2, 4, "Key: R" },
{ 0, 2, 5, "Key: T" },
{ 0, 2, 6, "Key: Y" },
{ 0, 2, 7, "Key: U" },
{ 0, 2, 8, "Key: I" },
{ 0, 2, 9, "Key: O" },
{ 0, 2, 10, "Key: P" },
{ 0, 2, 11, "Key: [" },
{ 0, 2, 12, "Key: ]" },
{ 0, 2, 13, "Key: \\ (ANSI)" },
{ 0, 2, 14, "Key: Delete" },
{ 0, 2, 15, "Key: End" },
{ 0, 2, 16, "Key: Page Down" },
{ 0, 2, 17, "Key: Number Pad 7" },
{ 0, 2, 18, "Key: Number Pad 8" },
{ 0, 2, 19, "Key: Number Pad 9" },
{ 0, 2, 20, "Key: Number Pad +" },
{ 0, 3, 0, "Key: Caps Lock" },
{ 0, 3, 1, "Key: A" },
{ 0, 3, 2, "Key: S" },
{ 0, 3, 3, "Key: D" },
{ 0, 3, 4, "Key: F" },
{ 0, 3, 5, "Key: G" },
{ 0, 3, 6, "Key: H" },
{ 0, 3, 7, "Key: J" },
{ 0, 3, 8, "Key: K" },
{ 0, 3, 9, "Key: L" },
{ 0, 3, 10, "Key: ;" },
{ 0, 3, 11, "Key: '" },
{ 0, 3, 12, "Key: #" },
{ 0, 3, 13, "Key: Enter" },
{ 0, 3, 17, "Key: Number Pad 4" },
{ 0, 3, 18, "Key: Number Pad 5" },
{ 0, 3, 19, "Key: Number Pad 6" },
{ 0, 4, 0, "Key: Left Shift" },
{ 0, 4, 1, "Key: \\ (ISO)" },
{ 0, 4, 2, "Key: Z" },
{ 0, 4, 3, "Key: X" },
{ 0, 4, 4, "Key: C" },
{ 0, 4, 5, "Key: V" },
{ 0, 4, 6, "Key: B" },
{ 0, 4, 7, "Key: N" },
{ 0, 4, 8, "Key: M" },
{ 0, 4, 9, "Key: ," },
{ 0, 4, 10, "Key: ." },
{ 0, 4, 11, "Key: /" },
{ 0, 4, 13, "Key: Right Shift" },
{ 0, 4, 15, "Key: Up Arrow" },
{ 0, 4, 17, "Key: Number Pad 1" },
{ 0, 4, 18, "Key: Number Pad 2" },
{ 0, 4, 19, "Key: Number Pad 3" },
{ 0, 4, 20, "Key: Number Pad Enter" },
{ 0, 5, 0, "Key: Left Control" },
{ 0, 5, 1, "Key: Left Windows" },
{ 0, 5, 2, "Key: Left Alt" },
{ 0, 5, 6, "Key: Space" },
{ 0, 5, 10, "Key: Right Alt" },
{ 0, 5, 11, "Key: Right Fn" },
{ 0, 5, 12, "Key: Menu" },
{ 0, 5, 13, "Key: Right Control" },
{ 0, 5, 14, "Key: Left Arrow" },
{ 0, 5, 15, "Key: Down Arrow" },
{ 0, 5, 16, "Key: Right Arrow" },
{ 0, 5, 18, "Key: Number Pad 0" },
{ 0, 5, 19, "Key: Number Pad ." },
};
#define HUNTSMAN_V2_TKL_KEYMAP_SIZE (sizeof(huntsman_v2_tkl_keymap) / sizeof(huntsman_v2_tkl_keymap[0]))
static const razer_key huntsman_v2_tkl_keymap[] =
{
/*---------------------------------------------------------------------*\
| Zone, Row, Column, Key |
\*---------------------------------------------------------------------*/
{ 0, 0, 1, "Key: Escape" },
{ 0, 0, 3, "Key: F1" },
{ 0, 0, 4, "Key: F2" },
{ 0, 0, 5, "Key: F3" },
{ 0, 0, 6, "Key: F4" },
{ 0, 0, 7, "Key: F5" },
{ 0, 0, 8, "Key: F6" },
{ 0, 0, 9, "Key: F7" },
{ 0, 0, 10, "Key: F8" },
{ 0, 0, 11, "Key: F9" },
{ 0, 0, 12, "Key: F10" },
{ 0, 0, 13, "Key: F11" },
{ 0, 0, 14, "Key: F12" },
{ 0, 0, 15, "Key: Print Screen" },
{ 0, 0, 16, "Key: Scroll Lock" },
{ 0, 0, 17, "Key: Pause/Break" },
{ 0, 1, 1, "Key: `" },
{ 0, 1, 2, "Key: 1" },
{ 0, 1, 3, "Key: 2" },
{ 0, 1, 4, "Key: 3" },
{ 0, 1, 5, "Key: 4" },
{ 0, 1, 6, "Key: 5" },
{ 0, 1, 7, "Key: 6" },
{ 0, 1, 8, "Key: 7" },
{ 0, 1, 9, "Key: 8" },
{ 0, 1, 10, "Key: 9" },
{ 0, 1, 11, "Key: 0" },
{ 0, 1, 12, "Key: -" },
{ 0, 1, 13, "Key: =" },
{ 0, 1, 14, "Key: Backspace" },
{ 0, 1, 15, "Key: Insert" },
{ 0, 1, 16, "Key: Home" },
{ 0, 1, 17, "Key: Page Up" },
{ 0, 2, 1, "Key: Tab" },
{ 0, 2, 2, "Key: Q" },
{ 0, 2, 3, "Key: W" },
{ 0, 2, 4, "Key: E" },
{ 0, 2, 5, "Key: R" },
{ 0, 2, 6, "Key: T" },
{ 0, 2, 7, "Key: Y" },
{ 0, 2, 8, "Key: U" },
{ 0, 2, 9, "Key: I" },
{ 0, 2, 10, "Key: O" },
{ 0, 2, 11, "Key: P" },
{ 0, 2, 12, "Key: [" },
{ 0, 2, 13, "Key: ]" },
{ 0, 2, 14, "Key: \\ (ANSI)" },
{ 0, 2, 15, "Key: Delete" },
{ 0, 2, 16, "Key: End" },
{ 0, 2, 17, "Key: Page Down" },
{ 0, 3, 1, "Key: Caps Lock" },
{ 0, 3, 2, "Key: A" },
{ 0, 3, 3, "Key: S" },
{ 0, 3, 4, "Key: D" },
{ 0, 3, 5, "Key: F" },
{ 0, 3, 6, "Key: G" },
{ 0, 3, 7, "Key: H" },
{ 0, 3, 8, "Key: J" },
{ 0, 3, 9, "Key: K" },
{ 0, 3, 10, "Key: L" },
{ 0, 3, 11, "Key: ;" },
{ 0, 3, 12, "Key: '" },
{ 0, 3, 13, "Key: #" },
{ 0, 3, 14, "Key: Enter" },
{ 0, 4, 1, "Key: Left Shift" },
{ 0, 4, 2, "Key: \\ (ISO)" },
{ 0, 4, 3, "Key: Z" },
{ 0, 4, 4, "Key: X" },
{ 0, 4, 5, "Key: C" },
{ 0, 4, 6, "Key: V" },
{ 0, 4, 7, "Key: B" },
{ 0, 4, 8, "Key: N" },
{ 0, 4, 9, "Key: M" },
{ 0, 4, 10, "Key: ," },
{ 0, 4, 11, "Key: ." },
{ 0, 4, 12, "Key: /" },
{ 0, 4, 14, "Key: Right Shift" },
{ 0, 4, 16, "Key: Up Arrow" },
{ 0, 5, 1, "Key: Left Control" },
{ 0, 5, 2, "Key: Left Windows" },
{ 0, 5, 3, "Key: Left Alt" },
{ 0, 5, 7, "Key: Space" },
{ 0, 5, 11, "Key: Right Alt" },
{ 0, 5, 12, "Key: Right Fn" },
{ 0, 5, 13, "Key: Menu" },
{ 0, 5, 14, "Key: Right Control" },
{ 0, 5, 15, "Key: Left Arrow" },
{ 0, 5, 16, "Key: Down Arrow" },
{ 0, 5, 17, "Key: Right Arrow" },
};
#define BLACKWIDOW_ELITE_KEYMAP_SIZE (sizeof(blackwidow_elite_keymap) / sizeof(blackwidow_elite_keymap[0]))
static const razer_key blackwidow_elite_keymap[] =
@@ -2411,6 +2924,68 @@ static const razer_device blackwidow_v3_tkl_device =
BLACKWIDOW_V3_TKL_KEYMAP_SIZE
};
/*-------------------------------------------------------------*\
| Razer Blackwidow V3 Mini (Wired) 1532:0258 |
| |
| Zone "Keyboard" |
| Matrix |
| 5 Rows, 16 Columns |
\*-------------------------------------------------------------*/
static const razer_zone blackwidow_v3_mini_zone =
{
"Keyboard",
ZONE_TYPE_MATRIX,
5,
16
};
static const razer_device blackwidow_v3_mini_wired_device =
{
"Razer BlackWidow V3 Mini (Wired)",
RAZER_BLACKWIDOW_V3_MINI_WIRED_PID,
DEVICE_TYPE_KEYBOARD,
true,
5,
16,
{
&blackwidow_v3_mini_zone,
NULL,
NULL,
NULL,
NULL,
NULL
},
blackwidow_v3_mini_keymap,
BLACKWIDOW_V3_MINI_KEYMAP_SIZE
};
/*-------------------------------------------------------------*\
| Razer Blackwidow V3 Mini (Wireless) 1532:0271 |
| |
| Zone "Keyboard" |
| Matrix |
| 5 Rows, 16 Columns |
\*-------------------------------------------------------------*/
static const razer_device blackwidow_v3_mini_wireless_device =
{
"Razer BlackWidow V3 Mini (Wireless)",
RAZER_BLACKWIDOW_V3_MINI_WIRELESS_PID,
DEVICE_TYPE_KEYBOARD,
true,
5,
16,
{
&blackwidow_v3_mini_zone,
NULL,
NULL,
NULL,
NULL,
NULL
},
blackwidow_v3_mini_keymap,
BLACKWIDOW_V3_MINI_KEYMAP_SIZE
};
/*-------------------------------------------------------------*\
| Razer Blackwidow X Chroma 1532:0216 |
| |
@@ -2738,6 +3313,53 @@ static const razer_device huntsman_elite_device =
HUNTSMAN_ELITE_KEYMAP_SIZE
};
/*-------------------------------------------------------------*\
| Razer Huntsman V2 Analog |
| |
| Zone "Keyboard" |
| Matrix |
| 6 Rows, 22 Columns |
| |
| Zone "Underglow" |
| Matrix |
| 3 Rows, 22 Columns |
\*-------------------------------------------------------------*/
static const razer_zone huntsman_v2_analog_keyboard_zone =
{
"Keyboard",
ZONE_TYPE_MATRIX,
6,
22
};
static const razer_zone huntsman_v2_analog_underglow_zone =
{
"Underglow",
ZONE_TYPE_MATRIX,
3,
22
};
static const razer_device huntsman_v2_analog_device =
{
"Razer Huntsman V2 Analog",
RAZER_HUNTSMAN_V2_ANALOG_PID,
DEVICE_TYPE_KEYBOARD,
true,
9,
22,
{
&huntsman_v2_analog_keyboard_zone,
&huntsman_v2_analog_underglow_zone,
NULL,
NULL,
NULL,
NULL
},
huntsman_v2_analog_keymap,
HUNTSMAN_V2_ANALOG_KEYMAP_SIZE
};
/*-------------------------------------------------------------*\
| Razer Huntsman Mini 1532:0257 |
| |
@@ -2808,6 +3430,76 @@ static const razer_device huntsman_te_device =
HUNTSMAN_TE_KEYMAP_SIZE
};
/*-------------------------------------------------------------*\
| Razer Huntsman V2 TKL 1532:026B |
| |
| Zone "Keyboard" |
| Matrix |
| 6 Rows, 18 Columns |
\*-------------------------------------------------------------*/
static const razer_zone huntsman_v2_tkl_zone =
{
"Keyboard",
ZONE_TYPE_MATRIX,
6,
18
};
static const razer_device huntsman_v2_tkl_device =
{
"Razer Huntsman V2 TKL",
RAZER_HUNTSMAN_V2_TKL_PID,
DEVICE_TYPE_KEYBOARD,
true,
6,
18,
{
&huntsman_v2_tkl_zone,
NULL,
NULL,
NULL,
NULL,
NULL
},
huntsman_v2_tkl_keymap,
HUNTSMAN_V2_TKL_KEYMAP_SIZE
};
/*-------------------------------------------------------------*\
| Razer Huntsman V2 1532:026C |
| |
| Zone "Keyboard" |
| Matrix |
| 6 Rows, 22 Columns |
\*-------------------------------------------------------------*/
static const razer_zone huntsman_v2_keyboard_zone =
{
"Keyboard",
ZONE_TYPE_MATRIX,
6,
22
};
static const razer_device huntsman_v2_device =
{
"Razer Huntsman V2",
RAZER_HUNTSMAN_V2_PID,
DEVICE_TYPE_KEYBOARD,
true,
9,
22,
{
&huntsman_v2_keyboard_zone,
NULL,
NULL,
NULL,
NULL,
NULL
},
huntsman_v2_keymap,
HUNTSMAN_V2_KEYMAP_SIZE
};
/*-------------------------------------------------------------------------*\
| LAPTOPS |
\*-------------------------------------------------------------------------*/
@@ -3613,8 +4305,8 @@ static const razer_device blade_pro_17_2021_device =
NULL,
NULL
},
NULL,
0
blade_17_pro_2021_keymap,
BLADE_17_PRO_2021_KEYMAP_SIZE
};
/*-------------------------------------------------------------*\
@@ -5576,6 +6268,41 @@ static const razer_device naga_trinity_device =
0
};
/*-------------------------------------------------------------*\
| Razer Viper 8kHz 1532:0091 |
| |
| Zone "Logo" |
| Matrix |
| 1 LED |
\*-------------------------------------------------------------*/
static const razer_zone viper_8khz_logo_zone =
{
"Logo",
ZONE_TYPE_SINGLE,
1,
1
};
static const razer_device viper_8khz_device =
{
"Razer Viper 8kHz",
RAZER_VIPER_8KHZ_PID,
DEVICE_TYPE_MOUSE,
true,
1,
1,
{
&viper_8khz_logo_zone,
NULL,
NULL,
NULL,
NULL,
NULL
},
NULL,
0
};
/*-------------------------------------------------------------*\
| Razer Viper Mini 1532:008A |
| |
@@ -6966,6 +7693,8 @@ static const razer_device* device_list[] =
&blackwidow_v3_pro_wireless_device,
&blackwidow_v3_pro_bluetooth_device,
&blackwidow_v3_tkl_device,
&blackwidow_v3_mini_wired_device,
&blackwidow_v3_mini_wireless_device,
&blackwidow_x_chroma_device,
&blackwidow_x_chroma_te_device,
&cynosa_chroma_device,
@@ -6976,6 +7705,8 @@ static const razer_device* device_list[] =
&huntsman_elite_device,
&huntsman_mini_device,
&huntsman_te_device,
&huntsman_v2_analog_device,
&huntsman_v2_tkl_device,
&ornata_chroma_device,
/*-----------------------------------------------------------------*\
| LAPTOPS |
@@ -7048,6 +7779,7 @@ static const razer_device* device_list[] =
&naga_hex_v2_device,
&naga_left_handed_device,
&naga_trinity_device,
&viper_8khz_device,
&viper_mini_device,
&viper_ultimate_wired_device,
&viper_ultimate_wireless_device,
@@ -45,18 +45,19 @@ RGBController_SteelSeriesRival::RGBController_SteelSeriesRival(SteelSeriesRivalC
description = "SteelSeries Rival Device";
location = rival->GetDeviceLocation();
serial = rival->GetSerialString();
version = rival->GetFirmwareVersion();
mode Direct;
Direct.name = "Direct";
Direct.value = STEELSERIES_RIVAL_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_MANUAL_SAVE;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Pulsate;
Pulsate.name = "Pulsate";
Pulsate.value = STEELSERIES_RIVAL_PULSATE;
Pulsate.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
Pulsate.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_MANUAL_SAVE;
Pulsate.color_mode = MODE_COLORS_PER_LED;
Pulsate.speed_min = STEELSERIES_RIVAL_EFFECT_PULSATE_MIN;
Pulsate.speed_max = STEELSERIES_RIVAL_EFFECT_PULSATE_MAX;
@@ -243,3 +244,9 @@ void RGBController_SteelSeriesRival::DeviceUpdateMode()
DeviceUpdateLEDs();
}
void RGBController_SteelSeriesRival::DeviceSaveMode()
{
DeviceUpdateMode();
rival->SaveMode();
}
@@ -28,6 +28,7 @@ public:
void SetCustomMode();
void DeviceUpdateMode();
void DeviceSaveMode();
private:
SteelSeriesRivalController* rival;
@@ -70,13 +70,28 @@ std::string SteelSeriesRivalController::GetSerialString()
return(return_string);
}
std::string SteelSeriesRivalController::GetFirmwareVersion()
{
if (proto != RIVAL_300 && proto != RIVAL_700) return "";
char usb_buf[2] = { 0x10, 0x00 };
uint16_t version;
std::string return_string;
send_usb_msg(dev, usb_buf, 2);
hid_read(dev, (unsigned char *)&version, 2);
return_string = std::to_string(version);
return return_string;
}
steelseries_type SteelSeriesRivalController::GetMouseType()
{
return proto;
}
/* Saves to the internal configuration */
void SteelSeriesRivalController::Save()
void SteelSeriesRivalController::SaveMode()
{
char usb_buf[9];
memset(usb_buf, 0x00, sizeof(usb_buf));
@@ -253,61 +268,32 @@ void SteelSeriesRivalController::SetRival700Color
unsigned char blue
)
{
char usb_buf[0xA5];
const uint16_t REPORT_SIZE = 578;
uint8_t usb_buf[REPORT_SIZE];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0x05;
usb_buf[0x02] = zone_id;
usb_buf[0x00] = 0x05;
usb_buf[0x02] = zone_id;
usb_buf[0x03] = 0x1D;
usb_buf[0x04] = 0x01;
usb_buf[0x05] = 0x02;
usb_buf[0x06] = 0x31;
usb_buf[0x07] = 0x51;
usb_buf[0x08] = 0xFF;
usb_buf[0x09] = 0xC8;
usb_buf[0x03] = red;
usb_buf[0x04] = green;
usb_buf[0x05] = blue;
// 128 bytes of unused color fields
usb_buf[0x0b] = zone_id;
usb_buf[0x0c] = 0x01;
// Static color value
unsigned short color_value;
color_value = ((unsigned short) red) << 4;
usb_buf[0x8D] = (unsigned char)(color_value & 0xFF);
usb_buf[0x8E] = (unsigned char)(color_value >> 8);
color_value = ((unsigned short) green) << 4;
usb_buf[0x8F] = (unsigned char)(color_value & 0xFF);
usb_buf[0x90] = (unsigned char)(color_value >> 8);
color_value = ((unsigned short) blue) << 4;
usb_buf[0x91] = (unsigned char)(color_value & 0xFF);
usb_buf[0x92] = (unsigned char)(color_value >> 8);
char *usb_pkt = new char[REPORT_SIZE + 1];
usb_buf[0x93] = 0xFF;
usb_buf[0x95] = 0xDC; // magic value: 1500
usb_buf[0x96] = 0x05;
usb_buf[0x97] = 0x8A; // magic value: 650
usb_buf[0x98] = 0x02;
usb_buf[0x9D] = 0x01;
// 0x9F and 0xA0 = number of colors in sequence - 1 = 0
usb_buf[0xA1] = 0xE8; // Default duration: 1000 ms
usb_buf[0xA2] = 0x03;
const int pkt_len = 0xA3 + 1;
unsigned char* usb_pkt = new unsigned char[pkt_len];
usb_pkt[0] = 0x00;
for(unsigned int i = 1; i < pkt_len; i++)
for (unsigned int i = 1; i < REPORT_SIZE + 1; i++)
{
usb_pkt[i] = usb_buf[i-1];
usb_pkt[i] = usb_buf[i - 1];
}
// hid_write(dev, (unsigned char *)usb_pkt, pkt_len);
hid_send_feature_report(dev, (unsigned char *)usb_pkt, pkt_len);
hid_send_feature_report(dev, (unsigned char *)usb_pkt, REPORT_SIZE + 1);
usb_buf[0x00] = 0x09;
usb_buf[0x01] = 0x00;
send_usb_msg(dev, usb_buf, 0x02);
delete[] usb_pkt;
}
void SteelSeriesRivalController::SetColor
@@ -45,10 +45,11 @@ public:
std::string GetDeviceLocation();
char* GetDeviceName();
std::string GetSerialString();
std::string GetFirmwareVersion();
steelseries_type GetMouseType();
void Save();
void SaveMode();
void SetLightEffect
(
+15 -3
View File
@@ -32,7 +32,7 @@ greaterThan(QT_MAJOR_VERSION, 4) {
#-----------------------------------------------------------------------------------------------#
# Application Configuration #
#-----------------------------------------------------------------------------------------------#
VERSION = 0.61
VERSION = 0.71
TARGET = OpenRGB
TEMPLATE = app
@@ -231,6 +231,7 @@ HEADERS +=
Controllers/AsusAuraUSBController/AsusAuraKeyboardController.h \
Controllers/AsusAuraUSBController/AsusAuraMainboardController.h \
Controllers/AsusAuraUSBController/AsusAuraMouseController.h \
Controllers/AsusAuraUSBController/AsusAuraMousematController.h \
Controllers/AsusAuraUSBController/AsusAuraMouseDevices.h \
Controllers/AsusAuraUSBController/AsusAuraStrixEvolveController.h \
Controllers/AsusAuraUSBController/AsusAuraTUFKeyboardController.h \
@@ -238,6 +239,7 @@ HEADERS +=
Controllers/AsusAuraUSBController/RGBController_AsusAuraHeadsetStand.h \
Controllers/AsusAuraUSBController/RGBController_AsusAuraKeyboard.h \
Controllers/AsusAuraUSBController/RGBController_AsusAuraMouse.h \
Controllers/AsusAuraUSBController/RGBController_AsusAuraMousemat.h \
Controllers/AsusAuraUSBController/RGBController_AsusAuraStrixEvolve.h \
Controllers/AsusAuraUSBController/RGBController_AsusAuraTUFKeyboard.h \
Controllers/AsusAuraUSBController/RGBController_AsusAuraUSB.h \
@@ -268,9 +270,11 @@ HEADERS +=
Controllers/CorsairLightingNodeController/CorsairLightingNodeController.h \
Controllers/CorsairLightingNodeController/RGBController_CorsairLightingNode.h \
Controllers/CorsairPeripheralController/CorsairPeripheralController.h \
Controllers/CorsairPeripheralController/CorsairK100Controller.h \
Controllers/CorsairPeripheralController/CorsairK100Controller.h \
Controllers/CorsairPeripheralController/CorsairK55RGBPROController.h \
Controllers/CorsairPeripheralController/RGBController_CorsairPeripheral.h \
Controllers/CorsairPeripheralController/RGBController_CorsairK100.h \
Controllers/CorsairPeripheralController/RGBController_CorsairK55RGBPRO.h \
Controllers/CorsairVengeanceController/CorsairVengeanceController.h \
Controllers/CorsairVengeanceController/RGBController_CorsairVengeance.h \
Controllers/CorsairVengeanceProController/CorsairVengeanceProController.h \
@@ -419,8 +423,10 @@ HEADERS +=
Controllers/QMKOpenRGBController/QMKOpenRGBController.h \
Controllers/QMKOpenRGBController/QMKOpenRGBRev9Controller.h \
Controllers/QMKOpenRGBController/QMKOpenRGBRevBController.h \
Controllers/QMKOpenRGBController/QMKOpenRGBRevDController.h \
Controllers/QMKOpenRGBController/RGBController_QMKOpenRGBRev9.h \
Controllers/QMKOpenRGBController/RGBController_QMKOpenRGBRevB.h \
Controllers/QMKOpenRGBController/RGBController_QMKOpenRGBRevD.h \
Controllers/RazerController/RazerController.h \
Controllers/RazerController/RazerKrakenController.h \
Controllers/RazerController/RazerDevices.h \
@@ -601,12 +607,14 @@ SOURCES +=
Controllers/AsusAuraUSBController/AsusAuraKeyboardController.cpp \
Controllers/AsusAuraUSBController/AsusAuraMainboardController.cpp \
Controllers/AsusAuraUSBController/AsusAuraMouseController.cpp \
Controllers/AsusAuraUSBController/AsusAuraMousematController.cpp \
Controllers/AsusAuraUSBController/AsusAuraStrixEvolveController.cpp \
Controllers/AsusAuraUSBController/AsusAuraTUFKeyboardController.cpp \
Controllers/AsusAuraUSBController/AsusAuraUSBControllerDetect.cpp \
Controllers/AsusAuraUSBController/RGBController_AsusAuraHeadsetStand.cpp \
Controllers/AsusAuraUSBController/RGBController_AsusAuraKeyboard.cpp \
Controllers/AsusAuraUSBController/RGBController_AsusAuraMouse.cpp \
Controllers/AsusAuraUSBController/RGBController_AsusAuraMousemat.cpp \
Controllers/AsusAuraUSBController/RGBController_AsusAuraStrixEvolve.cpp \
Controllers/AsusAuraUSBController/RGBController_AsusAuraTUFKeyboard.cpp \
Controllers/AsusAuraUSBController/RGBController_AsusAuraUSB.cpp \
@@ -646,8 +654,10 @@ SOURCES +=
Controllers/CorsairPeripheralController/CorsairPeripheralController.cpp \
Controllers/CorsairPeripheralController/CorsairPeripheralControllerDetect.cpp \
Controllers/CorsairPeripheralController/CorsairK100Controller.cpp \
Controllers/CorsairPeripheralController/CorsairK55RGBPROController.cpp \
Controllers/CorsairPeripheralController/RGBController_CorsairPeripheral.cpp \
Controllers/CorsairPeripheralController/RGBController_CorsairK100.cpp \
Controllers/CorsairPeripheralController/RGBController_CorsairK55RGBPRO.cpp \
Controllers/CorsairVengeanceController/CorsairVengeanceController.cpp \
Controllers/CorsairVengeanceController/CorsairVengeanceControllerDetect.cpp \
Controllers/CorsairVengeanceController/RGBController_CorsairVengeance.cpp \
@@ -839,8 +849,10 @@ SOURCES +=
Controllers/QMKOpenRGBController/QMKOpenRGBControllerDetect.cpp \
Controllers/QMKOpenRGBController/QMKOpenRGBRev9Controller.cpp \
Controllers/QMKOpenRGBController/QMKOpenRGBRevBController.cpp \
Controllers/QMKOpenRGBController/QMKOpenRGBRevDController.cpp \
Controllers/QMKOpenRGBController/RGBController_QMKOpenRGBRev9.cpp \
Controllers/QMKOpenRGBController/RGBController_QMKOpenRGBRevB.cpp \
Controllers/QMKOpenRGBController/RGBController_QMKOpenRGBRevD.cpp \
Controllers/RazerController/RazerController.cpp \
Controllers/RazerController/RazerKrakenController.cpp \
Controllers/RazerController/RazerControllerDetect.cpp \
@@ -1242,7 +1254,7 @@ unix:!macx {
icon.files+=qt/OpenRGB.png
metainfo.path=$$PREFIX/share/metainfo/
metainfo.files+=qt/org.openrgb.OpenRGB.metainfo.xml
rules.path=/lib/udev/rules.d/
rules.path=$$PREFIX/lib/udev/rules.d/
rules.files+=60-openrgb.rules
INSTALLS += target desktop icon metainfo rules
}
+7 -1
View File
@@ -17,7 +17,13 @@
#define OpenRGBPluginInterface_IID "com.OpenRGBPluginInterface"
#define OPENRGB_PLUGIN_API_VERSION 1
/*-----------------------------------------------------------------------------------------------------*\
| OpenRGB Plugin API Versions |
| 0: OpenRGB 0.6 Unversioned, early plugin API. |
| 1: OpenRGB 0.61 First versioned API, introduced with plugin settings changes |
| 2: OpenRGB 0.7 First released versioned API, callback unregister functions in ResourceManager |
\*-----------------------------------------------------------------------------------------------------*/
#define OPENRGB_PLUGIN_API_VERSION 2
/*-----------------------------------------------------------------------------------------------------*\
| Plugin Tab Location Values |
+2
View File
@@ -172,6 +172,7 @@ There have been two instances of hardware damage in OpenRGB's development and we
* OpenRGB-Client - Java Client (by morg): https://gitlab.com/mguimard/openrgb-client
* OpenRGB-SDK - NodeJS client (by Mola19): https://www.npmjs.com/package/openrgb-sdk
* OpenRGB-cppSDK - C++ client (by Youda008): https://github.com/Youda008/OpenRGB-cppSDK
* openrgb-rs - Rust client (by nicoulaj): https://github.com/nicoulaj/openrgb-rs
## Applications Supporting OpenRGB SDK
@@ -197,6 +198,7 @@ There have been two instances of hardware damage in OpenRGB's development and we
* Skin Plugin (by morg): https://gitlab.com/OpenRGBDevelopers/openrgbskinplugin
* Hardware Sync Plugin (by morg): https://gitlab.com/OpenRGBDevelopers/OpenRGBHardwareSyncPlugin
* Http Hook Plugin (by morg): https://gitlab.com/OpenRGBDevelopers/OpenRGBHttpHookPlugin
* Razer extras Plugin (by morg): https://gitlab.com/OpenRGBDevelopers/OpenRGBRazerExtrasPlugin
## Projects Used
+2 -2
View File
@@ -1553,13 +1553,13 @@ void RGBController::DeviceCallThreadFunction()
{
if(CallFlag_UpdateMode.load() == true)
{
CallFlag_UpdateMode = false;
DeviceUpdateMode();
CallFlag_UpdateMode = false;
}
if(CallFlag_UpdateLEDs.load() == true)
{
CallFlag_UpdateLEDs = false;
DeviceUpdateLEDs();
CallFlag_UpdateLEDs = false;
}
else
{
+74
View File
@@ -232,6 +232,22 @@ void ResourceManager::RegisterDeviceListChangeCallback(DeviceListChangeCallback
{
DeviceListChangeCallbacks.push_back(new_callback);
DeviceListChangeCallbackArgs.push_back(new_callback_arg);
LOG_TRACE("[ResourceManager] Registered device list change callback. Total callbacks registered: %d", DeviceListChangeCallbacks.size());
}
void ResourceManager::UnregisterDeviceListChangeCallback(DeviceListChangeCallback callback, void * callback_arg)
{
for(size_t idx = 0; idx < DeviceListChangeCallbacks.size(); idx++)
{
if(DeviceListChangeCallbacks[idx] == callback && DeviceListChangeCallbackArgs[idx] == callback_arg)
{
DeviceListChangeCallbacks.erase(DeviceListChangeCallbacks.begin() + idx);
DeviceListChangeCallbackArgs.erase(DeviceListChangeCallbackArgs.begin() + idx);
}
}
LOG_TRACE("[ResourceManager] Unregistered device list change callback. Total callbacks registered: %d", DeviceListChangeCallbacks.size());
}
void ResourceManager::RegisterI2CBusListChangeCallback(I2CBusListChangeCallback new_callback, void * new_callback_arg)
@@ -240,10 +256,38 @@ void ResourceManager::RegisterI2CBusListChangeCallback(I2CBusListChangeCallback
I2CBusListChangeCallbackArgs.push_back(new_callback_arg);
}
void ResourceManager::UnregisterI2CBusListChangeCallback(I2CBusListChangeCallback callback, void * callback_arg)
{
for(size_t idx = 0; idx < I2CBusListChangeCallbacks.size(); idx++)
{
if(I2CBusListChangeCallbacks[idx] == callback && I2CBusListChangeCallbackArgs[idx] == callback_arg)
{
I2CBusListChangeCallbacks.erase(I2CBusListChangeCallbacks.begin() + idx);
I2CBusListChangeCallbackArgs.erase(I2CBusListChangeCallbackArgs.begin() + idx);
}
}
}
void ResourceManager::RegisterDetectionProgressCallback(DetectionProgressCallback new_callback, void *new_callback_arg)
{
DetectionProgressCallbacks.push_back(new_callback);
DetectionProgressCallbackArgs.push_back(new_callback_arg);
LOG_TRACE("[ResourceManager] Registered detection progress callback. Total callbacks registered: %d", DetectionProgressCallbacks.size());
}
void ResourceManager::UnregisterDetectionProgressCallback(DetectionProgressCallback callback, void *callback_arg)
{
for(size_t idx = 0; idx < DetectionProgressCallbacks.size(); idx++)
{
if(DetectionProgressCallbacks[idx] == callback && DetectionProgressCallbackArgs[idx] == callback_arg)
{
DetectionProgressCallbacks.erase(DetectionProgressCallbacks.begin() + idx);
DetectionProgressCallbackArgs.erase(DetectionProgressCallbackArgs.begin() + idx);
}
}
LOG_TRACE("[ResourceManager] Unregistered detection progress callback. Total callbacks registered: %d", DetectionProgressCallbacks.size());
}
void ResourceManager::RegisterDetectionStartCallback(DetectionStartCallback new_callback, void *new_callback_arg)
@@ -252,12 +296,36 @@ void ResourceManager::RegisterDetectionStartCallback(DetectionStartCallback new_
DetectionStartCallbackArgs.push_back(new_callback_arg);
}
void ResourceManager::UnregisterDetectionStartCallback(DetectionStartCallback callback, void *callback_arg)
{
for(size_t idx = 0; idx < DetectionStartCallbacks.size(); idx++)
{
if(DetectionStartCallbacks[idx] == callback && DetectionStartCallbackArgs[idx] == callback_arg)
{
DetectionStartCallbacks.erase(DetectionStartCallbacks.begin() + idx);
DetectionStartCallbackArgs.erase(DetectionStartCallbackArgs.begin() + idx);
}
}
}
void ResourceManager::RegisterDetectionEndCallback(DetectionEndCallback new_callback, void *new_callback_arg)
{
DetectionEndCallbacks.push_back(new_callback);
DetectionEndCallbackArgs.push_back(new_callback_arg);
}
void ResourceManager::UnregisterDetectionEndCallback(DetectionEndCallback callback, void *callback_arg)
{
for(size_t idx = 0; idx < DetectionEndCallbacks.size(); idx++)
{
if(DetectionEndCallbacks[idx] == callback && DetectionEndCallbackArgs[idx] == callback_arg)
{
DetectionEndCallbacks.erase(DetectionEndCallbacks.begin() + idx);
DetectionEndCallbackArgs.erase(DetectionEndCallbackArgs.begin() + idx);
}
}
}
void ResourceManager::UpdateDeviceList()
{
DeviceListChangeMutex.lock();
@@ -318,6 +386,8 @@ void ResourceManager::DeviceListChanged()
/*-------------------------------------------------*\
| Device list has changed, call the callbacks |
\*-------------------------------------------------*/
LOG_TRACE("[ResourceManager] Calling device list change callbacks.");
for(unsigned int callback_idx = 0; callback_idx < DeviceListChangeCallbacks.size(); callback_idx++)
{
ResourceManager::DeviceListChangeCallbacks[callback_idx](DeviceListChangeCallbackArgs[callback_idx]);
@@ -331,6 +401,8 @@ void ResourceManager::DetectionProgressChanged()
/*-------------------------------------------------*\
| Detection progress has changed, call the callbacks|
\*-------------------------------------------------*/
LOG_TRACE("[ResourceManager] Calling detection progress callbacks.");
for(unsigned int callback_idx = 0; callback_idx < DetectionProgressCallbacks.size(); callback_idx++)
{
DetectionProgressCallbacks[callback_idx](DetectionProgressCallbackArgs[callback_idx]);
@@ -569,6 +641,8 @@ void ResourceManager::DetectDevices()
/*-----------------------------------------------------*\
| Call detection start callbacks |
\*-----------------------------------------------------*/
LOG_TRACE("[ResourceManager] Calling detection start callbacks.");
for(unsigned int callback_idx = 0; callback_idx < DetectionStartCallbacks.size(); callback_idx++)
{
DetectionStartCallbacks[callback_idx](DetectionStartCallbackArgs[callback_idx]);
+12
View File
@@ -67,6 +67,12 @@ public:
virtual void RegisterDetectionEndCallback(DetectionEndCallback new_callback, void * new_callback_arg) = 0;
virtual void RegisterI2CBusListChangeCallback(I2CBusListChangeCallback new_callback, void * new_callback_arg) = 0;
virtual void UnregisterDeviceListChangeCallback(DeviceListChangeCallback callback, void * callback_arg) = 0;
virtual void UnregisterDetectionProgressCallback(DetectionProgressCallback callback, void *callback_arg) = 0;
virtual void UnregisterDetectionStartCallback(DetectionStartCallback callback, void *callback_arg) = 0;
virtual void UnregisterDetectionEndCallback(DetectionEndCallback callback, void *callback_arg) = 0;
virtual void UnregisterI2CBusListChangeCallback(I2CBusListChangeCallback callback, void * callback_arg) = 0;
virtual std::vector<RGBController*> & GetRGBControllers() = 0;
virtual unsigned int GetDetectionPercent() = 0;
@@ -120,6 +126,12 @@ public:
void RegisterDetectionEndCallback(DetectionEndCallback new_callback, void * new_callback_arg);
void RegisterI2CBusListChangeCallback(I2CBusListChangeCallback new_callback, void * new_callback_arg);
void UnregisterDeviceListChangeCallback(DeviceListChangeCallback callback, void * callback_arg);
void UnregisterDetectionProgressCallback(DetectionProgressCallback callback, void *callback_arg);
void UnregisterDetectionStartCallback(DetectionStartCallback callback, void *callback_arg);
void UnregisterDetectionEndCallback(DetectionEndCallback callback, void *callback_arg);
void UnregisterI2CBusListChangeCallback(I2CBusListChangeCallback callback, void * callback_arg);
bool GetDetectionEnabled();
unsigned int GetDetectionPercent();
const char* GetDetectionString();
+1 -1
View File
@@ -1,4 +1,4 @@
openrgb (0.61.1) UNRELEASED; urgency=medium
openrgb (0.71.1) UNRELEASED; urgency=medium
* Builds from git master. See git history for more information.
+13 -4
View File
@@ -1,15 +1,15 @@
%global _name OpenRGB
Name: openrgb
Version: 0.6.1
Release: 1%{?dist}
Version: 0.7.1
Release: 0%{?dist}
Summary: Open source RGB lighting control that doesn't depend on manufacturer software
License: GPLv2
URL: https://gitlab.com/CalcProgrammer1/%{_name}
Source0: OpenRGB.tar.gz
BuildRequires: gcc-c++ libusb-devel libstdc++-devel qt5-qtbase-devel desktop-file-utils hidapi-devel mbedtls-devel
BuildRequires: gcc-c++ libusb-devel libstdc++-devel qt5-qtbase-devel desktop-file-utils hidapi-devel mbedtls-devel systemd-rpm-macros
Requires: hicolor-icon-theme
%description
@@ -42,11 +42,20 @@ fi
%{_datadir}/icons/hicolor/*/apps/%{_name}.png
%{_datadir}/applications/%{_name}.desktop
%{_metainfodir}/org.%{name}.%{_name}.metainfo.xml
/lib/udev/rules.d/60-%{name}.rules
%{_udevrulesdir}/60-%{name}.rules
%license LICENSE
%doc README.md
%changelog
* Thu Dec 30 2021 Adam Honse <[email protected]> - 0.7.1-0
- Updated to 0.7.1
* Thu Dec 30 2021 Adam Honse <[email protected]> - 0.7-0
- Updated to 0.7
* Sun Dec 12 2021 Artem Polishchuk <[email protected]> - 0.6.1-2
- build: Fix udev rules install path | MR#933
* Tue Jun 1 2021 Adam Honse <[email protected]> - 0.6.1-0
- Updated to 0.6-1
+4 -16
View File
@@ -183,14 +183,12 @@ s32 i2c_smbus_interface::i2c_smbus_xfer_call(u8 addr, char read_write, u8 comman
return(i2c_ret);
}
s32 i2c_smbus_interface::i2c_xfer_call(u8 addr, char read_write, int reg_size, u8* reg_data, int* size, u8 *data)
s32 i2c_smbus_interface::i2c_xfer_call(u8 addr, char read_write, int* size, u8 *data)
{
i2c_smbus_xfer_mutex.lock();
i2c_addr = addr;
i2c_read_write = read_write;
i2c_reg_size = reg_size;
i2c_reg_data = reg_data;
i2c_size = size;
i2c_data = data;
smbus_xfer = false;
@@ -212,22 +210,12 @@ s32 i2c_smbus_interface::i2c_xfer_call(u8 addr, char read_write, int reg_size, u
s32 i2c_smbus_interface::i2c_read_block(u8 addr, int* size, u8* data)
{
return i2c_xfer_call(addr, I2C_SMBUS_READ, 0, NULL, size, data);
return i2c_xfer_call(addr, I2C_SMBUS_READ, size, data);
}
s32 i2c_smbus_interface::i2c_write_block(u8 addr, int size, u8 *data)
{
return i2c_xfer_call(addr, I2C_SMBUS_WRITE, 0, NULL, &size, data);
}
s32 i2c_smbus_interface::i2c_read_block_reg(u8 addr, int reg_size, u8* reg_data, int* size, u8* data)
{
return i2c_xfer_call(addr, I2C_SMBUS_READ, reg_size, reg_data, size, data);
}
s32 i2c_smbus_interface::i2c_write_block_reg(u8 addr, int reg_size, u8* reg_data, int size, u8 *data)
{
return i2c_xfer_call(addr, I2C_SMBUS_WRITE, reg_size, reg_data, &size, data);
return i2c_xfer_call(addr, I2C_SMBUS_WRITE, &size, data);
}
void i2c_smbus_interface::i2c_smbus_thread_function()
@@ -250,7 +238,7 @@ void i2c_smbus_interface::i2c_smbus_thread_function()
}
else
{
i2c_ret = i2c_xfer(i2c_addr, i2c_read_write, i2c_reg_size, i2c_reg_data, i2c_size, i2c_data);
i2c_ret = i2c_xfer(i2c_addr, i2c_read_write, i2c_size, i2c_data);
}
std::unique_lock<std::mutex> done_lock(i2c_smbus_done_mutex);
+2 -6
View File
@@ -103,15 +103,13 @@ public:
//Addtional functions added for pure I2C block operations
s32 i2c_read_block(u8 addr, int* size, u8* data);
s32 i2c_write_block(u8 addr, int size, u8* data);
s32 i2c_read_block_reg(u8 addr, int reg_size, u8* reg_data, int* size, u8* data);
s32 i2c_write_block_reg(u8 addr, int reg_size, u8* reg_data, int size, u8* data);
//Handle SMBus and I2C transfer calls in a single thread
s32 i2c_smbus_xfer_call(u8 addr, char read_write, u8 command, int size, i2c_smbus_data* data);
s32 i2c_xfer_call(u8 addr, char read_write, int reg_size, u8* reg_data, int* size, u8 *data);
s32 i2c_xfer_call(u8 addr, char read_write, int* size, u8 *data);
virtual s32 i2c_smbus_xfer(u8 addr, char read_write, u8 command, int size, i2c_smbus_data* data) = 0;
virtual s32 i2c_xfer(u8 addr, char read_write, int reg_size, u8* reg_data, int* size, u8* data) = 0;
virtual s32 i2c_xfer(u8 addr, char read_write, int* size, u8* data) = 0;
private:
std::thread * i2c_smbus_thread;
@@ -132,10 +130,8 @@ private:
u16 i2c_command;
int i2c_size_smbus;
int* i2c_size;
int i2c_reg_size;
i2c_smbus_data* i2c_data_smbus;
u8* i2c_data;
u8* i2c_reg_data;
s32 i2c_ret;
bool smbus_xfer;
};
+1 -1
View File
@@ -194,7 +194,7 @@ s32 i2c_smbus_amdadl::i2c_smbus_xfer(u8 addr, char read_write, u8 command, int s
return (ret);
};
s32 i2c_smbus_amdadl::i2c_xfer(u8 addr, char read_write, int reg_size, u8* reg_data, int* size, u8* data)
s32 i2c_smbus_amdadl::i2c_xfer(u8 addr, char read_write, int* size, u8* data)
{
return -1;
}
+1 -1
View File
@@ -30,6 +30,6 @@ public:
private:
s32 i2c_smbus_xfer(u8 addr, char read_write, u8 command, int size, i2c_smbus_data* data);
s32 i2c_xfer(u8 addr, char read_write, int reg_size, u8* reg_data, int* size, u8* data);
s32 i2c_xfer(u8 addr, char read_write, int* size, u8* data);
ADL_CONTEXT_HANDLE context = NULL;
};
+1 -1
View File
@@ -484,7 +484,7 @@ s32 i2c_smbus_i801::i2c_smbus_xfer(u8 addr, char read_write, u8 command, int siz
return i801_access(addr, read_write, command, size, data);
}
s32 i2c_smbus_i801::i2c_xfer(u8 addr, char read_write, int reg_size, u8* reg_data, int* size, u8* data)
s32 i2c_smbus_i801::i2c_xfer(u8 addr, char read_write, int* size, u8* data)
{
return -1;
}
+1 -1
View File
@@ -92,5 +92,5 @@ private:
int i801_wait_byte_done();
int i801_wait_intr();
s32 i2c_smbus_xfer(u8 addr, char read_write, u8 command, int size, i2c_smbus_data* data);
s32 i2c_xfer(u8 addr, char read_write, int reg_size, u8* reg_data, int* size, u8* data);
s32 i2c_xfer(u8 addr, char read_write, int* size, u8* data);
};
+14 -62
View File
@@ -30,70 +30,20 @@ s32 i2c_smbus_linux::i2c_smbus_xfer(u8 addr, char read_write, u8 command, int si
return ioctl(handle, I2C_SMBUS, &args);
}
s32 i2c_smbus_linux::i2c_xfer(u8 addr, char read_write, int reg_size, u8* reg_data, int* size, u8* data)
s32 i2c_smbus_linux::i2c_xfer(u8 addr, char read_write, int* size, u8* data)
{
i2c_rdwr_ioctl_data rdwr;
i2c_msg msgs[2];
i2c_msg msg;
s32 ret_val;
/*-------------------------------------------------*\
| Ensure reg_size zero or positive |
\*-------------------------------------------------*/
if(reg_size < 0)
{
reg_size = 0;
}
msg.addr = addr;
msg.flags = read_write;
msg.len = *size;
msg.buf = (u8*)malloc(*size);
memcpy(&msg.buf, &data, *size);
/*-------------------------------------------------*\
| If operation is a write, create write message |
| consisting of reg data and data |
\*-------------------------------------------------*/
if(read_write == I2C_SMBUS_WRITE)
{
msgs[0].addr = addr;
msgs[0].flags = I2C_SMBUS_WRITE;
msgs[0].len = reg_size + *size;
msgs[0].buf = (u8*)malloc(reg_size + *size);
if(reg_size > 0)
{
memcpy(&msgs[0].buf, &reg_data, reg_size);
}
memcpy(&msgs[0].buf + reg_size, data, *size);
rdwr.msgs = &msgs[0];
rdwr.nmsgs = 1;
}
else
{
/*---------------------------------------------*\
| Create a read message |
\*---------------------------------------------*/
msgs[1].addr = addr;
msgs[1].flags = I2C_SMBUS_READ;
msgs[1].len = *size;
msgs[1].buf = (u8*)malloc(*size);
rdwr.msgs = &msgs[1];
rdwr.nmsgs = 1;
if(reg_size > 0)
{
/*-------------------------------------------------*\
| If operation is a read, create a write message |
| consisting of reg data if reg data is in use |
\*-------------------------------------------------*/
msgs[0].addr = addr;
msgs[0].flags = I2C_SMBUS_WRITE;
msgs[0].len = reg_size;
msgs[0].buf = (u8*)malloc(reg_size);
memcpy(&msgs[0].buf, &reg_data, reg_size);
rdwr.msgs = &msgs[0];
rdwr.nmsgs = 2;
}
}
rdwr.msgs = &msg;
rdwr.nmsgs = 1;
ret_val = ioctl(handle, I2C_RDWR, &rdwr);
@@ -102,10 +52,12 @@ s32 i2c_smbus_linux::i2c_xfer(u8 addr, char read_write, int reg_size, u8* reg_da
\*-------------------------------------------------*/
if(read_write == I2C_SMBUS_READ)
{
*size = msgs[1].len;
memcpy(data, &msgs[1].buf, *size);
*size = msg.len;
memcpy(data, &msg.buf, *size);
}
free(msg.buf);
return ret_val;
}
@@ -181,7 +133,7 @@ bool i2c_smbus_linux_detect()
strcat(path, ent->d_name);
if(ent->d_type == DT_LNK)
{
ptr = canonicalize_file_name(path);
ptr = realpath(path, NULL);
if(ptr == NULL)
continue;
+1 -1
View File
@@ -16,5 +16,5 @@ public:
private:
s32 i2c_smbus_xfer(u8 addr, char read_write, u8 command, int size, i2c_smbus_data* data);
s32 i2c_xfer(u8 addr, char read_write, int reg_size, u8* reg_data, int* size, u8* data);
s32 i2c_xfer(u8 addr, char read_write, int* size, u8* data);
};
+1 -1
View File
@@ -189,7 +189,7 @@ s32 i2c_smbus_nct6775::i2c_smbus_xfer(u8 addr, char read_write, u8 command, int
return nct6775_access(addr, read_write, command, size, data);
}
s32 i2c_smbus_nct6775::i2c_xfer(u8 addr, char read_write, int reg_size, u8* reg_data, int* size, u8* data)
s32 i2c_smbus_nct6775::i2c_xfer(u8 addr, char read_write, int* size, u8* data)
{
return -1;
}
+1 -1
View File
@@ -53,6 +53,6 @@ public:
private:
s32 nct6775_access(u16 addr, char read_write, u8 command, int size, i2c_smbus_data *data);
s32 i2c_smbus_xfer(u8 addr, char read_write, u8 command, int size, i2c_smbus_data* data);
s32 i2c_xfer(u8 addr, char read_write, int reg_size, u8* reg_data, int* size, u8* data);
s32 i2c_xfer(u8 addr, char read_write, int* size, u8* data);
};
+3 -3
View File
@@ -118,14 +118,14 @@ s32 i2c_smbus_nvapi::i2c_smbus_xfer(u8 addr, char read_write, u8 command, int mo
return(ret);
}
s32 i2c_smbus_nvapi::i2c_xfer(u8 addr, char read_write, int reg_size, u8* reg_data, int* size, u8* data)
s32 i2c_smbus_nvapi::i2c_xfer(u8 addr, char read_write, int* size, u8* data)
{
NV_STATUS ret;
unsigned int unknown = 0;
NV_I2C_INFO_V3 i2c_data;
i2c_data.i2c_reg_address = reg_data;
i2c_data.reg_addr_size = reg_size;
i2c_data.i2c_reg_address = NULL;
i2c_data.reg_addr_size = 0;
// Set up data buffer, zero bytes in length
i2c_data.data = data;
+1 -1
View File
@@ -21,6 +21,6 @@ public:
private:
s32 i2c_smbus_xfer(u8 addr, char read_write, u8 command, int mode, i2c_smbus_data* data);
s32 i2c_xfer(u8 addr, char read_write, int reg_size, u8* reg_data, int* size, u8* data);
s32 i2c_xfer(u8 addr, char read_write, int* size, u8* data);
NV_PHYSICAL_GPU_HANDLE handle;
};
+1 -1
View File
@@ -178,7 +178,7 @@ s32 i2c_smbus_piix4::i2c_smbus_xfer(u8 addr, char read_write, u8 command, int si
return piix4_access(addr, read_write, command, size, data);
}
s32 i2c_smbus_piix4::i2c_xfer(u8 addr, char read_write, int reg_size, u8* reg_data, int* size, u8* data)
s32 i2c_smbus_piix4::i2c_xfer(u8 addr, char read_write, int* size, u8* data)
{
return -1;
}
+1 -1
View File
@@ -45,5 +45,5 @@ private:
int piix4_transaction();
s32 piix4_access(u16 addr, char read_write, u8 command, int size, i2c_smbus_data *data);
s32 i2c_smbus_xfer(u8 addr, char read_write, u8 command, int size, i2c_smbus_data* data);
s32 i2c_xfer(u8 addr, char read_write, int reg_size, u8* reg_data, int* size, u8* data);
s32 i2c_xfer(u8 addr, char read_write, int* size, u8* data);
};
+21 -8
View File
@@ -19,6 +19,7 @@
| names here instead of referring to specific products. |
\*-----------------------------------------------------*/
#define AMD_POLARIS_DEV 0x67DF
#define AMD_POLARIS11 0x67FF
#define AMD_POLARIS20XL_DEV 0x6FDF
#define AMD_VEGA10_DEV 0x687F
#define AMD_NAVI10_DEV 0x731F
@@ -100,6 +101,14 @@
/*-----------------------------------------------------*\
| ASUS Sub-Device IDs |
\*-----------------------------------------------------*/
#define ASUS_VEGA64_STRIX 0x04C4
#define ASUS_RX5600XT_STRIX_O6G_GAMING 0x04EC
#define ASUS_RX5700XT_STRIX_GAMING_OC 0x04E2
#define ASUS_RX480_STRIX_GAMING_OC 0x04FB
#define ASUS_RX560_STRIX_4G_GAMING 0x04BC
#define ASUS_RX570_STRIX_O4G_GAMING_OC 0x04C2
#define ASUS_RX580_STRIX_GAMING_OC 0x0517
#define ASUS_RX580_STRIX_GAMING_TOP 0x0519
#define ASUS_GTX1050_STRIX_O2G_GAMING 0x85D8
#define ASUS_ROG_STRIX_GTX1050TI_O4G_GAMING 0x85CD
#define ASUS_GTX1060_STRIX_6G_GAMING 0x85A4
@@ -118,7 +127,10 @@
#define ASUS_ROG_STRIX_GTX1660S_O6G_GAMING 0x8752
#define ASUS_ROG_GTX1660TI_OC 0x86A5
#define ASUS_ROG_STRIX_RTX2060_EVO_GAMING 0x86D3
#define ASUS_ROG_STRIX_RTX2060_O6G_GAMING 0x868E
#define ASUS_ROG_STRIX_RTX2060_O6G_EVO_GAMING 0x8775
#define ASUS_ROG_STRIX_RTX2060S_A8G_EVO_GAMING 0x8703
#define ASUS_ROG_STRIX_RTX2060S_8G_GAMING 0x8730
#define ASUS_ROG_STRIX_RTX2060S_O8G_GAMING 0x86FB
#define ASUS_ROG_STRIX_RTX2070_A8G_GAMING 0x8671
#define ASUS_ROG_STRIX_RTX2070_O8G_GAMING 0x8670
@@ -128,14 +140,8 @@
#define ASUS_ROG_STRIX_RTX2070S_O8G_GAMING 0x8727
#define ASUS_ROG_STRIX_RTX2080_O8G_GAMING 0x865F
#define ASUS_ROG_STRIX_RTX2080S_O8G_GAMING 0x8711
#define ASUS_ROG_STRIX_RTX2080TI_11G_GAMING 0x8687
#define ASUS_ROG_STRIX_RTX2080TI_O11G_GAMING 0x866A
#define ASUS_VEGA64_STRIX 0x04C4
#define ASUS_RX5600XT_STRIX_O6G_GAMING 0x04EC
#define ASUS_RX5700XT_STRIX_GAMING_OC 0x04E2
#define ASUS_RX480_STRIX_GAMING_OC 0x04FB
#define ASUS_RX570_STRIX_O4G_GAMING_OC 0x04C2
#define ASUS_RX580_STRIX_GAMING_OC 0x0517
#define ASUS_RX580_STRIX_GAMING_TOP 0x0519
#define ASUS_ROG_STRIX_RTX_3060_O12G_GAMING 0x87F3
#define ASUS_TUF_RTX_3060_TI_O8G_OC 0x87C6
#define ASUS_ROG_STRIX_RTX_3070_OC 0x87B8
@@ -143,19 +149,22 @@
#define ASUS_ROG_STRIX_RTX_3070_08G_V2_GAMING 0x882C
#define ASUS_TUF_RTX_3070_O8G_GAMING 0x87C1
#define ASUS_TUF_RTX_3070_O8G_V2_GAMING 0x8825
#define ASUS_ROG_STRIX_RTX_3070TI_O8G_GAMING 0x880E
#define ASUS_ROG_STRIX_RTX_3080_O10G_GAMING 0x87AC
#define ASUS_ROG_STRIX_RTX_3080_O10G_WHITE 0x87D1
#define ASUS_ROG_STRIX_RTX_3080_O10G_V2_WHITE 0x8830
#define ASUS_TUF_RTX_3080_10G_GAMING_PD 0x87C4
#define ASUS_TUF_RTX_3080_O10G_OC 0x87B0
#define ASUS_TUF_RTX_3080_O10G_V2_GAMING_8822 0x8822
#define ASUS_TUF_RTX_3080_O10G_V2_GAMING 0x8823
#define ASUS_ROG_STRIX_RTX_3080TI_O12G_GAMING 0x8807
#define ASUS_ROG_STRIX_RTX_3070TI_O8G_GAMING 0x880E
#define ASUS_ROG_STRIX_RTX_3090_24G_GAMING 0x87AD
#define ASUS_ROG_STRIX_RTX_3090_O24G_GAMING 0x87AF
#define ASUS_ROG_STRIX_RTX_3090_O24G_GAMING_WHITE 0x87D9
#define ASUS_TUF_RTX_3090_O24G 0x87B5
#define ASUS_TUF_RTX_3090_O24G_OC 0x87B3
/*-----------------------------------------------------*\
| EVGA Sub-Device IDs |
\*-----------------------------------------------------*/
@@ -178,7 +187,9 @@
#define EVGA_RTX2080_XC_GAMING_SUB_DEV 0x2182
#define EVGA_RTX2080_XC_ULTRA_GAMING_SUB_DEV 0x2183
#define EVGA_RTX2080S_XC_GAMING_SUB_DEV 0x3182
#define EVGA_RTX2080S_XC_ULTRA_SUB_DEV 0x3183
#define EVGA_RTX2080S_FTW3_ULTRA_SUB_DEV 0x3287
#define EVGA_RTX2080S_FTW3_HYBRID_OC_SUB_DEV 0x3288
#define EVGA_RTX2080S_FTW3_ULTRA_HC_SUB_DEV 0x3289
#define EVGA_RTX2080TI_BLACK_SUB_DEV 0x2281
#define EVGA_RTX2080TI_XC_ULTRA_GAMING_SUB_DEV 0x2383
@@ -276,6 +287,7 @@
#define GIGABYTE_RTX2070S_GAMING_OC_3X_WHITE_SUB_DEV 0x400D
#define GIGABYTE_RTX2080_A_GAMING_OC_SUB_DEV 0x37A7
#define GIGABYTE_RTX2080_GAMING_OC_SUB_DEV 0x37D6
#define GIGABYTE_AORUS_RTX2080_SUB_DEV 0x37B2
#define GIGABYTE_RTX2080S_GAMING_OC_SUB_DEV 0x3FE9
#define GIGABYTE_RTX3060_GAMING_OC_12GB_SUB_DEV 0x4074
#define GIGABYTE_RTX3060_ELITE_12GB_SUB_DEV 0x407B
@@ -284,6 +296,7 @@
#define GIGABYTE_RTX3060TI_GAMING_OC_PRO_SUB_DEV 0x405E
#define GIGABYTE_RTX3070_GAMING_OC_SUB_DEV 0x404C
#define GIGABYTE_RTX3070_VISION_OC_SUB_DEV 0x404D
#define GIGABYTE_RTX3070_EAGLE_OC_SUB_DEV 0x404E
#define GIGABYTE_RTX3070_MASTER_OC_SUB_DEV 0x4069
#define GIGABYTE_RTX3070TI_GAMING_OC_SUB_DEV 0x408F
#define GIGABYTE_RTX3070TI_EAGLE_SUB_DEV 0x408C
+1
View File
@@ -93,6 +93,7 @@ static const std::map<std::string, led_label> led_label_lookup =
{ "Key: \\ (ISO)", { "\\" , "\\", }},
{ "Key: ;", { ";" , ";", }},
{ "Key: '", { "'" , "'", }},
{ "Key: #", { "#" , "#", }},
{ "Key: ,", { "," , ",", }},
{ "Key: .", { "." , ".", }},
{ "Key: /", { "/" , "/", }},
+8 -3
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>980</width>
<height>824</height>
<width>800</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
@@ -36,7 +36,7 @@
</sizepolicy>
</property>
<property name="text">
<string>There are some Addressable RGB zones that are not yet configured.&lt;br/&gt; Please enter the count of LEDs attached to each zone below.</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;One or more resizable zones have not been configured. Resizable zones are most commonly used for addressable RGB headers where the size of the connected device cannot be detected automatically.&lt;/p&gt;&lt;p&gt;Please enter the number of LEDs in each zone below.&lt;/p&gt;&lt;p&gt;For more information about calcuating the correct size, please check &lt;a href=&quot;https://openrgb.org/resize&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;this link.&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -103,6 +103,11 @@
</spacer>
</item>
</layout>
<zorder>do_not_show_again_checkbox</zorder>
<zorder>save_button</zorder>
<zorder>zones_table</zorder>
<zorder>ignore_button</zorder>
<zorder>help_label</zorder>
</widget>
<resources/>
<connections/>
-8
View File
@@ -8,14 +8,6 @@ Ui::TabLabel::TabLabel(QString icon, QString name) :
ui->setupUi(this);
ui->icon->setText("<img src=':/" + icon + "' height='16' width='16' />");
ui->name->setText(name);
/*---------------------------------------------------------*\
| Make sure to properly set the tab label height depending |
| on the font in use. |
\*---------------------------------------------------------*/
QFontMetrics fontMetrics(font());
QRect rect = fontMetrics.boundingRect(0, 0, width(), height(), Qt::TextWordWrap | Qt::TextExpandTabs, name);
setFixedHeight(std::max(rect.height(), ui->icon->height()));
}
Ui::TabLabel::~TabLabel()
+20 -4
View File
@@ -6,12 +6,12 @@
<rect>
<x>0</x>
<y>0</y>
<width>200</width>
<height>25</height>
<width>222</width>
<height>16</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -20,6 +20,9 @@
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetMinAndMaxSize</enum>
</property>
<property name="topMargin">
<number>0</number>
</property>
@@ -80,11 +83,23 @@
<item>
<widget class="QLabel" name="name">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<sizepolicy hsizetype="Fixed" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>device name</string>
</property>
@@ -98,3 +113,4 @@
<resources/>
<connections/>
</ui>
+1
View File
@@ -49,6 +49,7 @@
</description>
<releases>
<release version="0.7" date="2021-12-30"></release>
<release version="0.6" date="2021-06-01"></release>
<release version="0.5" date="2021-12-07"></release>
<release version="0.4" date="2020-09-09"></release>