From 1148e6e4ba2df61421aebdf7f4546b1c768af3be Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 18 Jan 2021 17:59:58 -0800 Subject: [PATCH] Debugger: Include all press states for convenience. In case of a multi-button shortcut, which might be common for debugging. --- Core/Debugger/WebSocket/InputBroadcaster.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Core/Debugger/WebSocket/InputBroadcaster.cpp b/Core/Debugger/WebSocket/InputBroadcaster.cpp index 1502c6702f..388000dbbc 100644 --- a/Core/Debugger/WebSocket/InputBroadcaster.cpp +++ b/Core/Debugger/WebSocket/InputBroadcaster.cpp @@ -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);