mirror of
https://github.com/MatMoul/g810-led.git
synced 2024-12-23 09:16:11 +00:00
commit
042d7bb3e0
@ -709,13 +709,15 @@ bool Keyboard::setKeys(KeyValue keyValue[], int keyValueCount) {
|
|||||||
if (multimediaCount > 0) setKeysInternal(KeyAddressGroup::multimedia, multimedia, multimediaCount);
|
if (multimediaCount > 0) setKeysInternal(KeyAddressGroup::multimedia, multimedia, multimediaCount);
|
||||||
|
|
||||||
if (keysCount > 0) {
|
if (keysCount > 0) {
|
||||||
int maxKeyValueCount = 2; // Normally max 14 but dont work
|
int maxKeyValueCount = 14;
|
||||||
for (int i = 0; i < keysCount; i = i + maxKeyValueCount) {
|
for (int i = 0; i < keysCount; i = i + maxKeyValueCount) {
|
||||||
KeyValue keysBlock[maxKeyValueCount];
|
KeyValue keysBlock[maxKeyValueCount];
|
||||||
int keysBlockCount = 0;
|
int keysBlockCount = 0;
|
||||||
for (int j = 0; j < maxKeyValueCount; j++) {
|
for (int j = 0; j < maxKeyValueCount; j++) {
|
||||||
keysBlock[j] = keys[i + j];
|
if((i + j) < keysCount ) {
|
||||||
keysBlockCount++;
|
keysBlock[j] = keys[i + j];
|
||||||
|
keysBlockCount++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
setKeysInternal(KeyAddressGroup::keys, keysBlock, keysBlockCount);
|
setKeysInternal(KeyAddressGroup::keys, keysBlock, keysBlockCount);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user