We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2f743b1 commit ff0685eCopy full SHA for ff0685e
trikNetwork/src/gamepadConnection.cpp
@@ -41,12 +41,16 @@ void GamepadConnection::processData(const QByteArray &data)
41
}
42
} else if (commandName == "btn") {
43
const int buttonCode = cmd.at(1).trimmed().toInt();
44
- emit button(buttonCode, 1);
+ int state = 1;
45
+ if (cmd.length() > 2) {
46
+ state = cmd.at(2) == "down" ? 1 : 0;
47
+ }
48
+
49
+ emit button(buttonCode, state);
50
} else if (commandName == "wheel") {
51
const int perc = cmd.at(1).trimmed().toInt();
52
emit wheel(perc);
53
} else {
54
QLOG_ERROR() << "Gamepad: unknown command" << commandName;
55
56
-
0 commit comments