diff --git a/makefile b/makefile index 4a16420..56738fd 100644 --- a/makefile +++ b/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 diff --git a/sample_profiles/colors b/sample_profiles/colors new file mode 100644 index 0000000..d87c950 --- /dev/null +++ b/sample_profiles/colors @@ -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 diff --git a/src/classes/Keyboard.cpp b/src/classes/Keyboard.cpp index c6ff8a5..472e45a 100644 --- a/src/classes/Keyboard.cpp +++ b/src/classes/Keyboard.cpp @@ -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(data.data()), data.size()) < 0) { std::cout<<"Error: Can not write to hidraw, try with the libusb version"<(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(data.data()), data.size(), 2000) < 0)