mirror of
https://github.com/MatMoul/g810-led.git
synced 2025-04-04 23:31:48 +00:00
added g815
This commit is contained in:
parent
f68e5addc5
commit
f35a49ef11
2
makefile
2
makefile
@ -64,6 +64,7 @@ setup:
|
|||||||
@test -s $(DESTDIR)/usr/bin/g512-led || ln -s /usr/bin/$(PROGN) $(DESTDIR)/usr/bin/g512-led
|
@test -s $(DESTDIR)/usr/bin/g512-led || ln -s /usr/bin/$(PROGN) $(DESTDIR)/usr/bin/g512-led
|
||||||
@test -s $(DESTDIR)/usr/bin/g513-led || ln -s /usr/bin/$(PROGN) $(DESTDIR)/usr/bin/g513-led
|
@test -s $(DESTDIR)/usr/bin/g513-led || ln -s /usr/bin/$(PROGN) $(DESTDIR)/usr/bin/g513-led
|
||||||
@test -s $(DESTDIR)/usr/bin/g610-led || ln -s /usr/bin/$(PROGN) $(DESTDIR)/usr/bin/g610-led
|
@test -s $(DESTDIR)/usr/bin/g610-led || ln -s /usr/bin/$(PROGN) $(DESTDIR)/usr/bin/g610-led
|
||||||
|
@test -s $(DESTDIR)/usr/bin/g815-led || ln -s /usr/bin/$(PROGN) $(DESTDIR)/usr/bin/g815-led
|
||||||
@test -s $(DESTDIR)/usr/bin/g910-led || ln -s /usr/bin/$(PROGN) $(DESTDIR)/usr/bin/g910-led
|
@test -s $(DESTDIR)/usr/bin/g910-led || ln -s /usr/bin/$(PROGN) $(DESTDIR)/usr/bin/g910-led
|
||||||
@test -s $(DESTDIR)/usr/bin/gpro-led || ln -s /usr/bin/$(PROGN) $(DESTDIR)/usr/bin/gpro-led
|
@test -s $(DESTDIR)/usr/bin/gpro-led || ln -s /usr/bin/$(PROGN) $(DESTDIR)/usr/bin/gpro-led
|
||||||
@cp sample_profiles/* $(DESTDIR)/etc/$(PROGN)/samples
|
@cp sample_profiles/* $(DESTDIR)/etc/$(PROGN)/samples
|
||||||
@ -111,6 +112,7 @@ uninstall:
|
|||||||
@rm /usr/bin/g512-led
|
@rm /usr/bin/g512-led
|
||||||
@rm /usr/bin/g513-led
|
@rm /usr/bin/g513-led
|
||||||
@rm /usr/bin/g610-led
|
@rm /usr/bin/g610-led
|
||||||
|
@rm /usr/bin/g815-led
|
||||||
@rm /usr/bin/g910-led
|
@rm /usr/bin/g910-led
|
||||||
@rm /usr/bin/gpro-led
|
@rm /usr/bin/gpro-led
|
||||||
@rm /usr/bin/$(PROGN)
|
@rm /usr/bin/$(PROGN)
|
||||||
|
@ -414,6 +414,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::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]);
|
||||||
@ -432,6 +433,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::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;
|
||||||
@ -441,6 +443,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::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;
|
||||||
@ -453,6 +456,7 @@ bool LedKeyboard::setKeys(KeyValueArray keyValues) {
|
|||||||
case LedKeyboard::KeyboardModel::g513:
|
case LedKeyboard::KeyboardModel::g513:
|
||||||
case LedKeyboard::KeyboardModel::g610:
|
case LedKeyboard::KeyboardModel::g610:
|
||||||
case LedKeyboard::KeyboardModel::g810:
|
case LedKeyboard::KeyboardModel::g810:
|
||||||
|
case LedKeyboard::KeyboardModel::g815:
|
||||||
case LedKeyboard::KeyboardModel::g910:
|
case LedKeyboard::KeyboardModel::g910:
|
||||||
case LedKeyboard::KeyboardModel::gpro:
|
case LedKeyboard::KeyboardModel::gpro:
|
||||||
if (SortedKeys[4].size() <= 120) SortedKeys[4].push_back(keyValues[i]);
|
if (SortedKeys[4].size() <= 120) SortedKeys[4].push_back(keyValues[i]);
|
||||||
@ -597,6 +601,7 @@ bool LedKeyboard::setAllKeys(LedKeyboard::Color color) {
|
|||||||
case KeyboardModel::g513:
|
case KeyboardModel::g513:
|
||||||
case KeyboardModel::g610:
|
case KeyboardModel::g610:
|
||||||
case KeyboardModel::g810:
|
case KeyboardModel::g810:
|
||||||
|
case KeyboardModel::g815:
|
||||||
case KeyboardModel::g910:
|
case KeyboardModel::g910:
|
||||||
case KeyboardModel::gpro:
|
case KeyboardModel::gpro:
|
||||||
for (uint8_t i = 0; i < keyGroupLogo.size(); i++) keyValues.push_back({keyGroupLogo[i], color});
|
for (uint8_t i = 0; i < keyGroupLogo.size(); i++) keyValues.push_back({keyGroupLogo[i], color});
|
||||||
@ -666,6 +671,7 @@ bool LedKeyboard::setMNKey(uint8_t value) {
|
|||||||
bool LedKeyboard::setGKeysMode(uint8_t value) {
|
bool LedKeyboard::setGKeysMode(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:
|
||||||
@ -705,6 +711,7 @@ bool LedKeyboard::setStartupMode(StartupMode startupMode) {
|
|||||||
case KeyboardModel::g410:
|
case KeyboardModel::g410:
|
||||||
case KeyboardModel::g610:
|
case KeyboardModel::g610:
|
||||||
case KeyboardModel::g810:
|
case KeyboardModel::g810:
|
||||||
|
case KeyboardModel::g815: // TODO - not working
|
||||||
case KeyboardModel::gpro:
|
case KeyboardModel::gpro:
|
||||||
data = { 0x11, 0xff, 0x0d, 0x5a, 0x00, 0x01 };
|
data = { 0x11, 0xff, 0x0d, 0x5a, 0x00, 0x01 };
|
||||||
break;
|
break;
|
||||||
@ -870,8 +877,14 @@ bool LedKeyboard::setNativeEffect(NativeEffect effect, NativeEffectPart part,
|
|||||||
bool LedKeyboard::sendDataInternal(byte_buffer_t &data) {
|
bool LedKeyboard::sendDataInternal(byte_buffer_t &data) {
|
||||||
if (data.size() > 0) {
|
if (data.size() > 0) {
|
||||||
#if defined(hidapi)
|
#if defined(hidapi)
|
||||||
|
|
||||||
|
//std::cout<<"model: "<<currentDevice.model<<std::endl;
|
||||||
|
//std::cout<<"vendorId: "<<currentDevice.vendorID<<std::endl;
|
||||||
|
//std::cout<<"productID: "<<currentDevice.productID<<std::endl;
|
||||||
|
|
||||||
if (! open(currentDevice.vendorID, currentDevice.productID, currentDevice.serialNumber)) return false;
|
if (! open(currentDevice.vendorID, currentDevice.productID, currentDevice.serialNumber)) return false;
|
||||||
if (hid_write(m_hidHandle, const_cast<unsigned char*>(data.data()), data.size()) < 0) {
|
if (hid_write(m_hidHandle, const_cast<unsigned char*>(data.data()), data.size()) < 0) {
|
||||||
|
|
||||||
std::cout<<"Error: Can not write to hidraw, try with the libusb version"<<std::endl;
|
std::cout<<"Error: Can not write to hidraw, try with the libusb version"<<std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -927,6 +940,7 @@ 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 };
|
||||||
|
@ -35,6 +35,7 @@ namespace help {
|
|||||||
else if(cmdName == "g513-led") return KeyboardFeatures::g513;
|
else if(cmdName == "g513-led") return KeyboardFeatures::g513;
|
||||||
else if(cmdName == "g610-led") return KeyboardFeatures::g610;
|
else if(cmdName == "g610-led") return KeyboardFeatures::g610;
|
||||||
else if(cmdName == "g810-led") return KeyboardFeatures::g810;
|
else if(cmdName == "g810-led") return KeyboardFeatures::g810;
|
||||||
|
else if(cmdName == "g815-led") return KeyboardFeatures::g815;
|
||||||
else if(cmdName == "g910-led") return KeyboardFeatures::g910;
|
else if(cmdName == "g910-led") return KeyboardFeatures::g910;
|
||||||
else if(cmdName == "gpro-led") return KeyboardFeatures::gpro;
|
else if(cmdName == "gpro-led") return KeyboardFeatures::gpro;
|
||||||
return KeyboardFeatures::all;
|
return KeyboardFeatures::all;
|
||||||
|
@ -50,6 +50,7 @@ namespace help {
|
|||||||
g513 = 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,
|
g610 = intensity | commit | logo1 | numpad | multimedia | setall | setgroup | setkey | setindicators | poweronfx | userstoredlighting,
|
||||||
g810 = rgb | commit | logo1 | numpad | multimedia | setall | setgroup | setkey | setindicators | poweronfx,
|
g810 = rgb | commit | logo1 | numpad | multimedia | setall | setgroup | setkey | setindicators | poweronfx,
|
||||||
|
g815 = rgb | commit | logo1 | numpad | multimedia | gkeys | setall | setgroup | setkey | setindicators | poweronfx,
|
||||||
g910 = rgb | commit | logo1 | logo2 | numpad | multimedia | gkeys | setall | setgroup | setkey | setindicators | poweronfx | userstoredlighting,
|
g910 = rgb | commit | logo1 | logo2 | numpad | multimedia | gkeys | setall | setgroup | setkey | setindicators | poweronfx | userstoredlighting,
|
||||||
gpro = rgb | commit | logo1 | setall | setgroup | setkey | setindicators | poweronfx | userstoredlighting
|
gpro = rgb | commit | logo1 | setall | setgroup | setkey | setindicators | poweronfx | userstoredlighting
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user