1
0
mirror of https://github.com/MatMoul/g810-led.git synced 2024-12-23 01:06:11 +00:00

Add support for g512

Signed-off-by: Paulo Flabiano Smorigo <pfsmorigo@gmail.com>
This commit is contained in:
Paulo Flabiano Smorigo 2020-01-04 22:10:00 -03:00
parent 118631d184
commit 1642d2dc02
No known key found for this signature in database
GPG Key ID: 6D4A7990BDE2CC66
5 changed files with 12 additions and 1 deletions

View File

@ -374,6 +374,7 @@ bool LedKeyboard::commit() {
case KeyboardModel::g413:
return true; // Keyboard is non-transactional
case KeyboardModel::g410:
case KeyboardModel::g512:
case KeyboardModel::g513:
case KeyboardModel::g610:
case KeyboardModel::g810:
@ -449,6 +450,7 @@ bool LedKeyboard::setKeys(KeyValueArray keyValues) {
break;
case LedKeyboard::KeyAddressGroup::keys:
switch (currentDevice.model) {
case LedKeyboard::KeyboardModel::g512:
case LedKeyboard::KeyboardModel::g513:
case LedKeyboard::KeyboardModel::g610:
case LedKeyboard::KeyboardModel::g810:
@ -588,6 +590,7 @@ bool LedKeyboard::setAllKeys(LedKeyboard::Color color) {
NativeEffectStorage::none);
return true;
case KeyboardModel::g410:
case KeyboardModel::g512:
case KeyboardModel::g513:
case KeyboardModel::g610:
case KeyboardModel::g810:
@ -752,6 +755,7 @@ bool LedKeyboard::setNativeEffect(NativeEffect effect, NativeEffectPart part,
if (part == NativeEffectPart::logo) return true; //Does not have logo component
break;
case KeyboardModel::g410:
case KeyboardModel::g512:
case KeyboardModel::g513:
case KeyboardModel::g610: // Unconfirmed
case KeyboardModel::g810:
@ -835,6 +839,7 @@ LedKeyboard::byte_buffer_t LedKeyboard::getKeyGroupAddress(LedKeyboard::KeyAddre
case KeyboardModel::g413:
return {}; // Device doesn't support per-key setting
case KeyboardModel::g410:
case KeyboardModel::g512:
case KeyboardModel::g513:
case KeyboardModel::gpro:
switch (keyAddressGroup) {

View File

@ -48,6 +48,7 @@ class LedKeyboard {
{ 0x46d, 0xc336, (uint16_t)KeyboardModel::g213 },
{ 0x46d, 0xc330, (uint16_t)KeyboardModel::g410 },
{ 0x46d, 0xc33a, (uint16_t)KeyboardModel::g413 },
{ 0x46d, 0xc342, (uint16_t)KeyboardModel::g512 },
{ 0x46d, 0xc33c, (uint16_t)KeyboardModel::g513 },
{ 0x46d, 0xc333, (uint16_t)KeyboardModel::g610 },
{ 0x46d, 0xc338, (uint16_t)KeyboardModel::g610 },
@ -63,6 +64,7 @@ class LedKeyboard {
g213,
g410,
g413,
g512,
g513,
g610,
g810,

View File

@ -32,6 +32,7 @@ namespace help {
if(cmdName == "g213-led") return KeyboardFeatures::g213;
else if(cmdName == "g410-led") return KeyboardFeatures::g410;
else if(cmdName == "g413-led") return KeyboardFeatures::g413;
else if(cmdName == "g512-led") return KeyboardFeatures::g512;
else if(cmdName == "g513-led") return KeyboardFeatures::g513;
else if(cmdName == "g610-led") return KeyboardFeatures::g610;
else if(cmdName == "g810-led") return KeyboardFeatures::g810;

View File

@ -47,6 +47,7 @@ namespace help {
g213 = rgb | logo1 | numpad | multimedia | setall | setregion | setindicators | poweronfx | userstoredlighting,
g410 = rgb | commit | setall | setgroup | setkey | poweronfx | userstoredlighting,
g413 = intensity | setall | userstoredlighting,
g512 = rgb | commit | numpad | setall | setgroup | setkey | setindicators | poweronfx | userstoredlighting,
g513 = rgb | commit | numpad | setall | setgroup | setkey | setindicators | poweronfx | userstoredlighting,
g610 = intensity | commit | logo1 | numpad | multimedia | setall | setgroup | setkey | setindicators | poweronfx | userstoredlighting,
g810 = rgb | commit | logo1 | numpad | multimedia | setall | setgroup | setkey | setindicators | poweronfx,

View File

@ -1,6 +1,7 @@
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c336", MODE="666" RUN+="/usr/bin/g213-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c330", MODE="666" RUN+="/usr/bin/g410-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c33a", MODE="666" RUN+="/usr/bin/g413-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c342", MODE="666" RUN+="/usr/bin/g512-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c33c", MODE="666" RUN+="/usr/bin/g513-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c333", MODE="666" RUN+="/usr/bin/g610-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c338", MODE="666" RUN+="/usr/bin/g610-led -p /etc/g810-led/profile"
@ -12,6 +13,7 @@ ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c3
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c336", MODE="666" RUN+="/usr/bin/g213-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c330", MODE="666" RUN+="/usr/bin/g410-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c33a", MODE="666" RUN+="/usr/bin/g413-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c342", MODE="666" RUN+="/usr/bin/g512-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c33c", MODE="666" RUN+="/usr/bin/g513-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c333", MODE="666" RUN+="/usr/bin/g610-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c338", MODE="666" RUN+="/usr/bin/g610-led -p /etc/g810-led/profile"