From f3edab82ce5f0ecdbc8f9fd0a48bddd2665064ec Mon Sep 17 00:00:00 2001 From: PixlOne <8843371+PixlOne@users.noreply.github.com> Date: Sun, 29 Mar 2020 18:05:40 -0400 Subject: [PATCH] Fix unsupported functions on ReprogControls --- src/logid/Device.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/logid/Device.cpp b/src/logid/Device.cpp index 4b4c153..79d0784 100644 --- a/src/logid/Device.cpp +++ b/src/logid/Device.cpp @@ -162,6 +162,15 @@ void Device::divert_buttons() { log_printf(DEBUG, "%s does not support Reprog controls, not diverting!", name.c_str()); } + catch(HIDPP20::Error &e) + { + if(e.errorCode() == HIDPP20::Error::InvalidFunctionID) { + // Not really an error, the device does not support diverting buttons + } + else { + log_printf(ERROR, "Could not divert buttons: HID++ 2.0 Error %s!", e.what()); + } + } catch(HIDPP10::Error &e) { log_printf(DEBUG, "Could not divert buttons: HID++ 1.0 Error %s!", e.what());