From 72f5f230eb82f5a7af0225a5e73c6122e81b27da Mon Sep 17 00:00:00 2001 From: Christopher Reimer Date: Sat, 11 Mar 2017 22:30:29 +0100 Subject: [PATCH] Make hidapi wait for at least 1ms for any answer from the keyboard. Setting this to 0 seems to make hidapi skip the read. And at least the G910 doesn't seem to like this very much. --- src/classes/Keyboard.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/classes/Keyboard.cpp b/src/classes/Keyboard.cpp index 1feea96..5b9a9cf 100644 --- a/src/classes/Keyboard.cpp +++ b/src/classes/Keyboard.cpp @@ -562,10 +562,9 @@ bool LedKeyboard::sendDataInternal(byte_buffer_t &data) { std::cout<<"Error: Can not write to hidraw, try with the libusb version"<(data2.data()), data2.size(), 0); + hid_read_timeout(m_hidHandle, const_cast(data2.data()), data2.size(), 1); return true; #elif defined(libusb) if (data.size() > 20) {