From 09978eafb9bb0311a08ca9ecacff7c6af9231bdd Mon Sep 17 00:00:00 2001 From: fincs Date: Wed, 2 Dec 2020 00:50:14 +0100 Subject: [PATCH] strat/cfg: Update for new libnx HID interface --- .../source/cfg/cfg_override.cpp | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/libraries/libstratosphere/source/cfg/cfg_override.cpp b/libraries/libstratosphere/source/cfg/cfg_override.cpp index 7391059a8..fb819e29a 100644 --- a/libraries/libstratosphere/source/cfg/cfg_override.cpp +++ b/libraries/libstratosphere/source/cfg/cfg_override.cpp @@ -34,7 +34,7 @@ namespace ams::cfg { constexpr ProgramOverrideKey DefaultAppletPhotoViewerOverrideKey = { .override_key = { - .key_combination = KEY_R, + .key_combination = HidNpadButton_R, .override_by_default = true, }, .program_id = ncm::SystemAppletId::PhotoViewer, @@ -58,12 +58,12 @@ namespace ams::cfg { /* Override globals. */ OverrideKey g_default_override_key = { - .key_combination = KEY_L, + .key_combination = HidNpadButton_L, .override_by_default = true, }; OverrideKey g_default_cheat_enable_key = { - .key_combination = KEY_L, + .key_combination = HidNpadButton_L, .override_by_default = true, }; @@ -89,7 +89,7 @@ namespace ams::cfg { impl::OverrideStatusFlag_AddressSpace64Bit, }, .override_any_app_key = { - .key_combination = KEY_R, + .key_combination = HidNpadButton_R, .override_by_default = false, }, .override_any_app_as_flag = impl::OverrideStatusFlag_AddressSpace64Bit, @@ -110,41 +110,41 @@ namespace ams::cfg { /* Parse key combination. */ if (strcasecmp(value, "A") == 0) { - cfg.key_combination = KEY_A; + cfg.key_combination = HidNpadButton_A; } else if (strcasecmp(value, "B") == 0) { - cfg.key_combination = KEY_B; + cfg.key_combination = HidNpadButton_B; } else if (strcasecmp(value, "X") == 0) { - cfg.key_combination = KEY_X; + cfg.key_combination = HidNpadButton_X; } else if (strcasecmp(value, "Y") == 0) { - cfg.key_combination = KEY_Y; + cfg.key_combination = HidNpadButton_Y; } else if (strcasecmp(value, "LS") == 0) { - cfg.key_combination = KEY_LSTICK; + cfg.key_combination = HidNpadButton_StickL; } else if (strcasecmp(value, "RS") == 0) { - cfg.key_combination = KEY_RSTICK; + cfg.key_combination = HidNpadButton_StickR; } else if (strcasecmp(value, "L") == 0) { - cfg.key_combination = KEY_L; + cfg.key_combination = HidNpadButton_L; } else if (strcasecmp(value, "R") == 0) { - cfg.key_combination = KEY_R; + cfg.key_combination = HidNpadButton_R; } else if (strcasecmp(value, "ZL") == 0) { - cfg.key_combination = KEY_ZL; + cfg.key_combination = HidNpadButton_ZL; } else if (strcasecmp(value, "ZR") == 0) { - cfg.key_combination = KEY_ZR; + cfg.key_combination = HidNpadButton_ZR; } else if (strcasecmp(value, "PLUS") == 0) { - cfg.key_combination = KEY_PLUS; + cfg.key_combination = HidNpadButton_Plus; } else if (strcasecmp(value, "MINUS") == 0) { - cfg.key_combination = KEY_MINUS; + cfg.key_combination = HidNpadButton_Minus; } else if (strcasecmp(value, "DLEFT") == 0) { - cfg.key_combination = KEY_DLEFT; + cfg.key_combination = HidNpadButton_Left; } else if (strcasecmp(value, "DUP") == 0) { - cfg.key_combination = KEY_DUP; + cfg.key_combination = HidNpadButton_Up; } else if (strcasecmp(value, "DRIGHT") == 0) { - cfg.key_combination = KEY_DRIGHT; + cfg.key_combination = HidNpadButton_Right; } else if (strcasecmp(value, "DDOWN") == 0) { - cfg.key_combination = KEY_DDOWN; + cfg.key_combination = HidNpadButton_Down; } else if (strcasecmp(value, "SL") == 0) { - cfg.key_combination = KEY_SL; + cfg.key_combination = HidNpadButton_AnySL; } else if (strcasecmp(value, "SR") == 0) { - cfg.key_combination = KEY_SR; + cfg.key_combination = HidNpadButton_AnySR; } return cfg;