Debugger: Include all press states for convenience.

In case of a multi-button shortcut, which might be common for debugging.
This commit is contained in:
Unknown W. Brackets committed 2021-01-18 18:14:48 -08:00
1 parent f97df5d153
commit 1148e6e4ba
1 file changed
+7 -1
+7 -1
View File
@@ -26,8 +26,9 @@
//
// Sent unexpectedly with these properties:
// - buttons: an object with button names as keys and bool press state as values.
// - changed: same as buttons, but only including changed states.
//
// See input.buttons.send in InputSubscriber for button names. Only changed buttons are sent.
// See input.buttons.send in InputSubscriber for button names.
// Analog position change (input.analog)
//
@@ -55,6 +56,11 @@ static std::string ButtonsEvent(uint32_t lastButtons, uint32_t newButtons) {
j.begin();
j.writeString("event", "input.buttons");
j.pushDict("buttons");
for (auto it : WebSocketInputButtonLookup()) {
j.writeBool(it.first, (newButtons & it.second) != 0);
}
j.pop();
j.pushDict("changed");
for (auto it : WebSocketInputButtonLookup()) {
if (pressed & it.second) {
j.writeBool(it.first, true);