From eab2d056803b38863c0021de8b5d0edace4b3528 Mon Sep 17 00:00:00 2001 From: leo60228 Date: Sun, 12 May 2019 10:43:49 -0400 Subject: [PATCH] Do same in dmnt and reboot_to_payload --- stratosphere/dmnt/source/dmnt_hid.cpp | 8 ++++++-- troposphere/reboot_to_payload/source/main.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/stratosphere/dmnt/source/dmnt_hid.cpp b/stratosphere/dmnt/source/dmnt_hid.cpp index 7e331d2bf..959ffb79e 100644 --- a/stratosphere/dmnt/source/dmnt_hid.cpp +++ b/stratosphere/dmnt/source/dmnt_hid.cpp @@ -26,7 +26,11 @@ Result HidManagement::GetKeysDown(u64 *keys) { std::scoped_lock lk(g_hid_keys_down_lock); hidScanInput(); - *keys = hidKeysHeld(CONTROLLER_P1_AUTO); + *keys = 0; + + for (int controller = 0; controller < 10; controller++) { + *keys |= hidKeysHeld((HidControllerID) controller); + } return ResultSuccess; -} \ No newline at end of file +} diff --git a/troposphere/reboot_to_payload/source/main.c b/troposphere/reboot_to_payload/source/main.c index 89f0e6258..3c6dcf0e1 100644 --- a/troposphere/reboot_to_payload/source/main.c +++ b/troposphere/reboot_to_payload/source/main.c @@ -79,8 +79,12 @@ int main(int argc, char **argv) //Scan all the inputs. This should be done once for each frame hidScanInput(); - //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kDown = 0; + + for (int controller = 0; controller < 10; controller++) { + // hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) + kDown |= hidKeysDown((HidControllerID) controller); + } if (can_reboot && kDown & KEY_MINUS) { reboot_to_payload();