Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6128731df6 | ||
|
|
6ca090d5f4 | ||
|
|
57e7e6a823 | ||
|
|
bdecbd77fc | ||
|
|
938f67016c | ||
|
|
6d5ca0b539 | ||
|
|
b877787e12 | ||
|
|
5186161fdd | ||
|
|
341607ec3e | ||
|
|
46d8ca718e | ||
|
|
101550bb6c | ||
|
|
ccbe83919a | ||
|
|
6e7a59a8d9 | ||
|
|
84c21919e1 | ||
|
|
c6c4e76e04 | ||
|
|
be1b982d71 | ||
|
|
c362719771 | ||
|
|
35a827d25c |
+106
-161
@@ -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 #
|
||||
#-----------------------------------------------------------------------#
|
||||
|
||||
@@ -236,6 +236,8 @@ 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}=="1b3e", TAG+="uaccess"
|
||||
@@ -542,6 +544,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 +582,9 @@ 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}=="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"
|
||||
|
||||
@@ -62,6 +62,7 @@ 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" },
|
||||
|
||||
@@ -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 }
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -225,7 +225,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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#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_SCIMITAR_PRO_RGB_PID 0x1B3E
|
||||
@@ -152,6 +153,7 @@ REGISTER_HID_DETECTOR_IP("Corsair Glaive RGB PRO", DetectCorsairPeriph
|
||||
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 Scimitar PRO RGB", DetectCorsairPeripheralControllers, CORSAIR_VID, CORSAIR_SCIMITAR_PRO_RGB_PID, 1, 0xFFC2);
|
||||
|
||||
@@ -96,6 +96,7 @@ 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" },
|
||||
|
||||
@@ -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 ¤t_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 ¤t_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:
|
||||
@@ -77,6 +78,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 +132,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 +141,8 @@ 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_ORNATA_CHROMA_PID:
|
||||
case RAZER_ORNATA_CHROMA_V2_PID:
|
||||
case RAZER_CORE_PID:
|
||||
@@ -203,6 +214,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 +237,8 @@ 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_KRAKEN_KITTY_EDITION_PID:
|
||||
case RAZER_LANCEHEAD_TE_WIRED_PID:
|
||||
case RAZER_LANCEHEAD_2017_WIRED_PID:
|
||||
@@ -444,6 +459,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 +498,8 @@ 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_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
|
||||
{
|
||||
@@ -221,6 +252,8 @@ REGISTER_HID_DETECTOR_IPU("Razer Blackwidow V3 Pro (Wired)", Det
|
||||
// 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 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,8 @@ 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 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);
|
||||
|
||||
@@ -344,6 +379,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);
|
||||
|
||||
@@ -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,8 @@
|
||||
#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_ORBWEAVER_CHROMA_PID 0x0207
|
||||
#define RAZER_ORNATA_CHROMA_PID 0x021E
|
||||
#define RAZER_ORNATA_CHROMA_V2_PID 0x025D
|
||||
@@ -523,6 +527,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[] =
|
||||
@@ -1122,6 +1206,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 +1610,104 @@ static const razer_key huntsman_te_keymap[] =
|
||||
{ 0, 5, 17, "Key: Right Arrow" },
|
||||
};
|
||||
|
||||
#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 +2712,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 +3101,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 +3218,41 @@ 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
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| LAPTOPS |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
@@ -6966,6 +7411,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 +7423,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 |
|
||||
|
||||
+6
-2
@@ -32,7 +32,7 @@ greaterThan(QT_MAJOR_VERSION, 4) {
|
||||
#-----------------------------------------------------------------------------------------------#
|
||||
# Application Configuration #
|
||||
#-----------------------------------------------------------------------------------------------#
|
||||
VERSION = 0.61
|
||||
VERSION = 0.7
|
||||
TARGET = OpenRGB
|
||||
TEMPLATE = app
|
||||
|
||||
@@ -419,8 +419,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 \
|
||||
@@ -839,8 +841,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 +1246,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
|
||||
}
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
openrgb (0.61.1) UNRELEASED; urgency=medium
|
||||
openrgb (0.7.0) UNRELEASED; urgency=medium
|
||||
|
||||
* Builds from git master. See git history for more information.
|
||||
|
||||
|
||||
+10
-4
@@ -1,15 +1,15 @@
|
||||
%global _name OpenRGB
|
||||
|
||||
Name: openrgb
|
||||
Version: 0.6.1
|
||||
Release: 1%{?dist}
|
||||
Version: 0.7
|
||||
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,17 @@ 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-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
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ s32 i2c_smbus_linux::i2c_xfer(u8 addr, char read_write, int* size, u8* data)
|
||||
{
|
||||
i2c_rdwr_ioctl_data rdwr;
|
||||
i2c_msg msg;
|
||||
s32 ret_val;
|
||||
|
||||
msg.addr = addr;
|
||||
msg.flags = read_write;
|
||||
@@ -44,8 +45,20 @@ s32 i2c_smbus_linux::i2c_xfer(u8 addr, char read_write, int* size, u8* data)
|
||||
rdwr.msgs = &msg;
|
||||
rdwr.nmsgs = 1;
|
||||
|
||||
ioctl(handle, I2C_SLAVE, addr);
|
||||
return ioctl(handle, I2C_RDWR, &rdwr);
|
||||
ret_val = ioctl(handle, I2C_RDWR, &rdwr);
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| If operation was a read, copy read data and size |
|
||||
\*-------------------------------------------------*/
|
||||
if(read_write == I2C_SMBUS_READ)
|
||||
{
|
||||
*size = msg.len;
|
||||
memcpy(data, &msg.buf, *size);
|
||||
}
|
||||
|
||||
free(msg.buf);
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
#include "Detector.h"
|
||||
|
||||
@@ -128,6 +128,7 @@
|
||||
#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
|
||||
@@ -145,6 +146,7 @@
|
||||
#define ASUS_TUF_RTX_3070_O8G_V2_GAMING 0x8825
|
||||
#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
|
||||
|
||||
@@ -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.<br/> Please enter the count of LEDs attached to each zone below.</string>
|
||||
<string><html><head/><body><p>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.</p><p>Please enter the number of LEDs in each zone below.</p><p>For more information about calcuating the correct size, please check <a href="https://openrgb.org/resize"><span style=" text-decoration: underline; color:#0000ff;">this link.</span></a></p></body></html></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/>
|
||||
|
||||
Reference in New Issue
Block a user