mirror of
https://github.com/MatMoul/g810-led.git
synced 2024-12-23 01:06:11 +00:00
Merge branch 'develop' into daemon
This commit is contained in:
commit
c5938507e0
2
makefile
2
makefile
@ -18,7 +18,7 @@ includedir?=$(prefix)/include
|
||||
PROGN=g810-led
|
||||
MAJOR=0
|
||||
MINOR=2
|
||||
MICRO=3
|
||||
MICRO=5
|
||||
|
||||
CFLAGS+=-DVERSION=\"$(MAJOR).$(MINOR).$(MICRO)\"
|
||||
APPSRCS=src/main.cpp src/helpers/*.cpp src/helpers/*.h
|
||||
|
28
sample_profiles/colors
Normal file
28
sample_profiles/colors
Normal file
@ -0,0 +1,28 @@
|
||||
# Sample profile using Groups of Keys and Single Characters.
|
||||
|
||||
g logo 000096 # Blue
|
||||
g indicators ffffff # White
|
||||
g multimedia 009600 # Green
|
||||
g fkeys ff7700 # Orange
|
||||
g modifiers ff7700 # Orange
|
||||
g arrows 0000ff # Red
|
||||
g numeric 00ff00 # Green
|
||||
g functions ffffff # White
|
||||
g keys ff00ff # Purple
|
||||
g gkeys ffffff # White
|
||||
k tilde ff0000 # Red
|
||||
k W 0000ff # Blue {
|
||||
k A 0000ff
|
||||
k S 0000ff
|
||||
k D 0000ff # }
|
||||
k 1 ff0000 # Red {
|
||||
k 2 ff0000
|
||||
k 3 ff0000
|
||||
k 4 ff0000
|
||||
k 5 ff0000
|
||||
k 6 ff0000
|
||||
k 7 ff0000
|
||||
k 8 ff0000
|
||||
k 9 ff0000
|
||||
k 0 ff0000 # }
|
||||
c # Commit changes
|
@ -781,20 +781,23 @@ bool LedKeyboard::setNativeEffect(NativeEffect effect, NativeEffectPart part, ui
|
||||
|
||||
|
||||
bool LedKeyboard::sendDataInternal(byte_buffer_t &data) {
|
||||
if (! m_isOpen) return false;
|
||||
|
||||
if (data.size() > 0) {
|
||||
#if defined(hidapi)
|
||||
if (! open()) return false;
|
||||
data.insert(data.begin(), 0x00);
|
||||
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;
|
||||
return false;
|
||||
}
|
||||
close();
|
||||
/*
|
||||
byte_buffer_t data2;
|
||||
data2.resize(21, 0x00);
|
||||
hid_read_timeout(m_hidHandle, const_cast<unsigned char*>(data2.data()), data2.size(), 1);
|
||||
*/
|
||||
return true;
|
||||
#elif defined(libusb)
|
||||
if (! m_isOpen) return false;
|
||||
if (data.size() > 20) {
|
||||
if(libusb_control_transfer(m_hidHandle, 0x21, 0x09, 0x0212, 1,
|
||||
const_cast<unsigned char*>(data.data()), data.size(), 2000) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user