mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-15 03:27:49 +01:00
loader/ams_mitm: Change Down -> Held in API
This commit is contained in:
parent
35167da6dd
commit
51fa778fb2
@ -446,7 +446,7 @@ bool Utils::HasSdDisableMitMFlag(u64 tid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Result Utils::GetKeysDown(u64 *keys) {
|
||||
Result Utils::GetKeysHeld(u64 *keys) {
|
||||
if (!Utils::IsHidAvailable()) {
|
||||
return MAKERESULT(Module_Libnx, LibnxError_InitFail_HID);
|
||||
}
|
||||
@ -459,7 +459,7 @@ Result Utils::GetKeysDown(u64 *keys) {
|
||||
|
||||
static bool HasOverrideKey(OverrideKey *cfg) {
|
||||
u64 kDown = 0;
|
||||
bool keys_triggered = (R_SUCCEEDED(Utils::GetKeysDown(&kDown)) && ((kDown & cfg->key_combination) != 0));
|
||||
bool keys_triggered = (R_SUCCEEDED(Utils::GetKeysHeld(&kDown)) && ((kDown & cfg->key_combination) != 0));
|
||||
return Utils::IsSdInitialized() && (cfg->override_by_default ^ keys_triggered);
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ class Utils {
|
||||
|
||||
|
||||
static bool IsHidAvailable();
|
||||
static Result GetKeysDown(u64 *keys);
|
||||
static Result GetKeysHeld(u64 *keys);
|
||||
|
||||
static OverrideKey GetTitleOverrideKey(u64 tid);
|
||||
static bool HasOverrideButton(u64 tid);
|
||||
|
@ -376,7 +376,7 @@ OverrideKey ContentManagement::GetTitleOverrideKey(u64 tid) {
|
||||
|
||||
static bool ShouldOverrideContents(OverrideKey *cfg) {
|
||||
u64 kDown = 0;
|
||||
bool keys_triggered = (R_SUCCEEDED(HidManagement::GetKeysDown(&kDown)) && ((kDown & cfg->key_combination) != 0));
|
||||
bool keys_triggered = (R_SUCCEEDED(HidManagement::GetKeysHeld(&kDown)) && ((kDown & cfg->key_combination) != 0));
|
||||
return g_has_initialized_fs_dev && (cfg->override_by_default ^ keys_triggered);
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "ldr_content_management.hpp"
|
||||
#include "ldr_hid.hpp"
|
||||
|
||||
Result HidManagement::GetKeysDown(u64 *keys) {
|
||||
Result HidManagement::GetKeysHeld(u64 *keys) {
|
||||
if (!ContentManagement::HasCreatedTitle(0x0100000000000013)) {
|
||||
return MAKERESULT(Module_Libnx, LibnxError_InitFail_HID);
|
||||
}
|
||||
|
@ -19,5 +19,5 @@
|
||||
|
||||
class HidManagement {
|
||||
public:
|
||||
static Result GetKeysDown(u64 *keys);
|
||||
static Result GetKeysHeld(u64 *keys);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user