mirror of
https://github.com/MatMoul/g810-led.git
synced 2025-04-04 23:31:48 +00:00
lights now working for: logo, multimedia, indicators, gkeys
This commit is contained in:
parent
51216a00d8
commit
9069b9a53f
@ -377,10 +377,12 @@ bool LedKeyboard::commit() {
|
|||||||
case KeyboardModel::g513:
|
case KeyboardModel::g513:
|
||||||
case KeyboardModel::g610:
|
case KeyboardModel::g610:
|
||||||
case KeyboardModel::g810:
|
case KeyboardModel::g810:
|
||||||
case KeyboardModel::g815:
|
|
||||||
case KeyboardModel::gpro:
|
case KeyboardModel::gpro:
|
||||||
data = { 0x11, 0xff, 0x0c, 0x5a };
|
data = { 0x11, 0xff, 0x0c, 0x5a };
|
||||||
break;
|
break;
|
||||||
|
case KeyboardModel::g815:
|
||||||
|
data = { 0x11, 0xff, 0x10, 0x7f };
|
||||||
|
break;
|
||||||
case KeyboardModel::g910:
|
case KeyboardModel::g910:
|
||||||
data = { 0x11, 0xff, 0x0f, 0x5d };
|
data = { 0x11, 0xff, 0x0f, 0x5d };
|
||||||
break;
|
break;
|
||||||
@ -414,7 +416,7 @@ bool LedKeyboard::setKeys(KeyValueArray keyValues) {
|
|||||||
switch (currentDevice.model) {
|
switch (currentDevice.model) {
|
||||||
case LedKeyboard::KeyboardModel::g610:
|
case LedKeyboard::KeyboardModel::g610:
|
||||||
case LedKeyboard::KeyboardModel::g810:
|
case LedKeyboard::KeyboardModel::g810:
|
||||||
case LedKeyboard::KeyboardModel::g815: // TODO - not working
|
case LedKeyboard::KeyboardModel::g815:
|
||||||
case LedKeyboard::KeyboardModel::gpro:
|
case LedKeyboard::KeyboardModel::gpro:
|
||||||
if (SortedKeys[0].size() <= 1 && keyValues[i].key == LedKeyboard::Key::logo)
|
if (SortedKeys[0].size() <= 1 && keyValues[i].key == LedKeyboard::Key::logo)
|
||||||
SortedKeys[0].push_back(keyValues[i]);
|
SortedKeys[0].push_back(keyValues[i]);
|
||||||
@ -433,7 +435,7 @@ bool LedKeyboard::setKeys(KeyValueArray keyValues) {
|
|||||||
switch (currentDevice.model) {
|
switch (currentDevice.model) {
|
||||||
case LedKeyboard::KeyboardModel::g610:
|
case LedKeyboard::KeyboardModel::g610:
|
||||||
case LedKeyboard::KeyboardModel::g810:
|
case LedKeyboard::KeyboardModel::g810:
|
||||||
case LedKeyboard::KeyboardModel::g815: // TODO - not working
|
case LedKeyboard::KeyboardModel::g815:
|
||||||
case LedKeyboard::KeyboardModel::gpro:
|
case LedKeyboard::KeyboardModel::gpro:
|
||||||
if (SortedKeys[2].size() <= 5) SortedKeys[2].push_back(keyValues[i]);
|
if (SortedKeys[2].size() <= 5) SortedKeys[2].push_back(keyValues[i]);
|
||||||
break;
|
break;
|
||||||
@ -443,7 +445,7 @@ bool LedKeyboard::setKeys(KeyValueArray keyValues) {
|
|||||||
break;
|
break;
|
||||||
case LedKeyboard::KeyAddressGroup::gkeys:
|
case LedKeyboard::KeyAddressGroup::gkeys:
|
||||||
switch (currentDevice.model) {
|
switch (currentDevice.model) {
|
||||||
case LedKeyboard::KeyboardModel::g815: // TODO - not working
|
case LedKeyboard::KeyboardModel::g815:
|
||||||
case LedKeyboard::KeyboardModel::g910:
|
case LedKeyboard::KeyboardModel::g910:
|
||||||
if (SortedKeys[3].size() <= 9) SortedKeys[3].push_back(keyValues[i]);
|
if (SortedKeys[3].size() <= 9) SortedKeys[3].push_back(keyValues[i]);
|
||||||
break;
|
break;
|
||||||
@ -490,15 +492,36 @@ bool LedKeyboard::setKeys(KeyValueArray keyValues) {
|
|||||||
data = getKeyGroupAddress(LedKeyboard::KeyAddressGroup::logo);
|
data = getKeyGroupAddress(LedKeyboard::KeyAddressGroup::logo);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
data_size = 64;
|
switch (currentDevice.model) {
|
||||||
|
case LedKeyboard::KeyboardModel::g815:
|
||||||
|
data_size = 20;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
data_size = 64;
|
||||||
|
break;
|
||||||
|
}
|
||||||
data = getKeyGroupAddress(LedKeyboard::KeyAddressGroup::indicators);
|
data = getKeyGroupAddress(LedKeyboard::KeyAddressGroup::indicators);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
data_size = 64;
|
switch (currentDevice.model) {
|
||||||
|
case LedKeyboard::KeyboardModel::g815:
|
||||||
|
data_size = 20;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
data_size = 64;
|
||||||
|
break;
|
||||||
|
}
|
||||||
data = getKeyGroupAddress(LedKeyboard::KeyAddressGroup::multimedia);
|
data = getKeyGroupAddress(LedKeyboard::KeyAddressGroup::multimedia);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
data_size = 64;
|
switch (currentDevice.model) {
|
||||||
|
case LedKeyboard::KeyboardModel::g815:
|
||||||
|
data_size = 20;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
data_size = 64;
|
||||||
|
break;
|
||||||
|
}
|
||||||
data = getKeyGroupAddress(LedKeyboard::KeyAddressGroup::gkeys);
|
data = getKeyGroupAddress(LedKeyboard::KeyAddressGroup::gkeys);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
@ -625,6 +648,7 @@ bool LedKeyboard::setAllKeys(LedKeyboard::Color color) {
|
|||||||
bool LedKeyboard::setMRKey(uint8_t value) {
|
bool LedKeyboard::setMRKey(uint8_t value) {
|
||||||
LedKeyboard::byte_buffer_t data;
|
LedKeyboard::byte_buffer_t data;
|
||||||
switch (currentDevice.model) {
|
switch (currentDevice.model) {
|
||||||
|
case KeyboardModel::g815: // TODO - not working
|
||||||
case KeyboardModel::g910:
|
case KeyboardModel::g910:
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
@ -645,6 +669,7 @@ bool LedKeyboard::setMRKey(uint8_t value) {
|
|||||||
bool LedKeyboard::setMNKey(uint8_t value) {
|
bool LedKeyboard::setMNKey(uint8_t value) {
|
||||||
LedKeyboard::byte_buffer_t data;
|
LedKeyboard::byte_buffer_t data;
|
||||||
switch (currentDevice.model) {
|
switch (currentDevice.model) {
|
||||||
|
case KeyboardModel::g815: // TODO - not working
|
||||||
case KeyboardModel::g910:
|
case KeyboardModel::g910:
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
@ -936,7 +961,6 @@ LedKeyboard::byte_buffer_t LedKeyboard::getKeyGroupAddress(LedKeyboard::KeyAddre
|
|||||||
break;
|
break;
|
||||||
case KeyboardModel::g610:
|
case KeyboardModel::g610:
|
||||||
case KeyboardModel::g810:
|
case KeyboardModel::g810:
|
||||||
case KeyboardModel::g815: // TODO - not working
|
|
||||||
switch (keyAddressGroup) {
|
switch (keyAddressGroup) {
|
||||||
case LedKeyboard::KeyAddressGroup::logo:
|
case LedKeyboard::KeyAddressGroup::logo:
|
||||||
return { 0x11, 0xff, 0x0c, 0x3a, 0x00, 0x10, 0x00, 0x01 };
|
return { 0x11, 0xff, 0x0c, 0x3a, 0x00, 0x10, 0x00, 0x01 };
|
||||||
@ -950,6 +974,19 @@ LedKeyboard::byte_buffer_t LedKeyboard::getKeyGroupAddress(LedKeyboard::KeyAddre
|
|||||||
return { 0x12, 0xff, 0x0c, 0x3a, 0x00, 0x01, 0x00, 0x0e };
|
return { 0x12, 0xff, 0x0c, 0x3a, 0x00, 0x01, 0x00, 0x0e };
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case KeyboardModel::g815:
|
||||||
|
switch (keyAddressGroup) {
|
||||||
|
case LedKeyboard::KeyAddressGroup::logo:
|
||||||
|
return { 0x11, 0xff, 0x10, 0x1b };
|
||||||
|
case LedKeyboard::KeyAddressGroup::indicators:
|
||||||
|
return { 0x11, 0xff, 0x10, 0x1f };
|
||||||
|
case LedKeyboard::KeyAddressGroup::gkeys:
|
||||||
|
return { 0x11, 0xff, 0x10, 0x1f };
|
||||||
|
case LedKeyboard::KeyAddressGroup::multimedia:
|
||||||
|
return { 0x11, 0xff, 0x10, 0x1f };
|
||||||
|
case LedKeyboard::KeyAddressGroup::keys:
|
||||||
|
return { 0x12, 0xff, 0x0c, 0x3a, 0x00, 0x01, 0x00, 0x0e };
|
||||||
|
}
|
||||||
case KeyboardModel::g910:
|
case KeyboardModel::g910:
|
||||||
switch (keyAddressGroup) {
|
switch (keyAddressGroup) {
|
||||||
case LedKeyboard::KeyAddressGroup::logo:
|
case LedKeyboard::KeyAddressGroup::logo:
|
||||||
|
@ -121,18 +121,28 @@ class LedKeyboard {
|
|||||||
};
|
};
|
||||||
enum class Key : uint16_t { // 127 items
|
enum class Key : uint16_t { // 127 items
|
||||||
|
|
||||||
logo = static_cast<uint8_t>(KeyAddressGroup::logo) << 8 | 0x01,
|
//logo = static_cast<uint8_t>(KeyAddressGroup::logo) << 8 | 0x01,
|
||||||
|
logo = static_cast<uint8_t>(KeyAddressGroup::logo) << 8 | 0xd2, // hack for G815
|
||||||
logo2,
|
logo2,
|
||||||
|
|
||||||
backlight = static_cast<uint8_t>(KeyAddressGroup::indicators) << 8| 0x01,
|
backlight = static_cast<uint8_t>(KeyAddressGroup::indicators) << 8| 0x99, // hack for G815
|
||||||
game, caps, scroll, num,
|
game, caps, scroll, num,
|
||||||
|
|
||||||
next = static_cast<uint8_t>(KeyAddressGroup::multimedia) << 8 | 0xb5,
|
//next = static_cast<uint8_t>(KeyAddressGroup::multimedia) << 8 | 0xb5,
|
||||||
prev, stop,
|
//prev, stop,
|
||||||
play = static_cast<uint8_t>(KeyAddressGroup::multimedia) << 8 | 0xcd,
|
//play = static_cast<uint8_t>(KeyAddressGroup::multimedia) << 8 | 0xcd,
|
||||||
mute = static_cast<uint8_t>(KeyAddressGroup::multimedia) << 8 | 0xe2,
|
//mute = static_cast<uint8_t>(KeyAddressGroup::multimedia) << 8 | 0xe2,
|
||||||
|
|
||||||
g1 = static_cast<uint8_t>(KeyAddressGroup::gkeys) << 8 | 0x01,
|
//next = static_cast<uint8_t>(KeyAddressGroup::multimedia) << 8 | 0x9d, // hack for G815
|
||||||
|
//prev = static_cast<uint8_t>(KeyAddressGroup::multimedia) << 8 | 0x9e, // hack for G815
|
||||||
|
//stop = static_cast<uint8_t>(KeyAddressGroup::multimedia) << 8 | 0x9f, // hack for G815
|
||||||
|
//play = static_cast<uint8_t>(KeyAddressGroup::multimedia) << 8 | 0x9b, // hack for G815
|
||||||
|
//mute = static_cast<uint8_t>(KeyAddressGroup::multimedia) << 8 | 0x9c, // hack for G815
|
||||||
|
play = static_cast<uint8_t>(KeyAddressGroup::multimedia) << 8 | 0x9b, // hack for G815
|
||||||
|
mute, next, prev, stop,
|
||||||
|
|
||||||
|
//g1 = static_cast<uint8_t>(KeyAddressGroup::gkeys) << 8 | 0x01,
|
||||||
|
g1 = static_cast<uint8_t>(KeyAddressGroup::gkeys) << 8 | 0xb4, // hack for G815
|
||||||
g2, g3, g4, g5, g6, g7, g8, g9,
|
g2, g3, g4, g5, g6, g7, g8, g9,
|
||||||
|
|
||||||
a = static_cast<uint8_t>(KeyAddressGroup::keys) << 8 | 0x04,
|
a = static_cast<uint8_t>(KeyAddressGroup::keys) << 8 | 0x04,
|
||||||
|
Loading…
Reference in New Issue
Block a user