1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-12-23 10:52:13 +00:00

loader/ams_mitm: hidKeysHeld, not hidKeysDown (and remove workaround)

This commit is contained in:
Michael Scire 2019-03-15 18:34:55 -07:00
parent 7551bebb88
commit 83626923cf
2 changed files with 7 additions and 7 deletions

View file

@ -220,8 +220,6 @@ void Utils::InitializeThreadFunc(void *args) {
} }
g_has_hid_session = true; g_has_hid_session = true;
hidExit();
} }
} }
@ -449,14 +447,13 @@ bool Utils::HasSdDisableMitMFlag(u64 tid) {
} }
Result Utils::GetKeysDown(u64 *keys) { Result Utils::GetKeysDown(u64 *keys) {
if (!Utils::IsHidAvailable() || R_FAILED(hidInitialize())) { if (!Utils::IsHidAvailable()) {
return MAKERESULT(Module_Libnx, LibnxError_InitFail_HID); return MAKERESULT(Module_Libnx, LibnxError_InitFail_HID);
} }
hidScanInput(); hidScanInput();
*keys = hidKeysDown(CONTROLLER_P1_AUTO); *keys = hidKeysHeld(CONTROLLER_P1_AUTO);
hidExit();
return 0x0; return 0x0;
} }

View file

@ -21,13 +21,16 @@
#include "ldr_hid.hpp" #include "ldr_hid.hpp"
Result HidManagement::GetKeysDown(u64 *keys) { Result HidManagement::GetKeysDown(u64 *keys) {
if (!ContentManagement::HasCreatedTitle(0x0100000000000013) || R_FAILED(hidInitialize())) { if (!ContentManagement::HasCreatedTitle(0x0100000000000013)) {
return MAKERESULT(Module_Libnx, LibnxError_InitFail_HID);
}
if (!serviceIsActive(hidGetSessionService()) && R_FAILED(hidInitialize())) {
return MAKERESULT(Module_Libnx, LibnxError_InitFail_HID); return MAKERESULT(Module_Libnx, LibnxError_InitFail_HID);
} }
hidScanInput(); hidScanInput();
*keys = hidKeysDown(CONTROLLER_P1_AUTO); *keys = hidKeysDown(CONTROLLER_P1_AUTO);
hidExit();
return 0x0; return 0x0;
} }