From 5bb2f20493f4e5788c05a6053c4e41eff3b3509b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20H=C3=B6glund?= Date: Fri, 28 Aug 2015 17:05:51 +0200 Subject: [PATCH] Use KeyDef for Confirm/Cancel/TabLeft/TabRight keys --- Common/KeyMap.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Common/KeyMap.cpp b/Common/KeyMap.cpp index 6b6f447016..7db7721819 100644 --- a/Common/KeyMap.cpp +++ b/Common/KeyMap.cpp @@ -295,21 +295,21 @@ static void KeyCodesFromPspButton(int btn, std::vector *keycodes) { } void UpdateConfirmCancelKeys() { - std::vector confirmKeys, cancelKeys; - std::vector tabLeft, tabRight; + std::vector confirmKeys, cancelKeys; + std::vector tabLeft, tabRight; int confirmKey = g_Config.iButtonPreference == PSP_SYSTEMPARAM_BUTTON_CROSS ? CTRL_CROSS : CTRL_CIRCLE; int cancelKey = g_Config.iButtonPreference == PSP_SYSTEMPARAM_BUTTON_CROSS ? CTRL_CIRCLE : CTRL_CROSS; - KeyCodesFromPspButton(confirmKey, &confirmKeys); - KeyCodesFromPspButton(cancelKey, &cancelKeys); - KeyCodesFromPspButton(CTRL_LTRIGGER, &tabLeft); - KeyCodesFromPspButton(CTRL_RTRIGGER, &tabRight); + KeyFromPspButton(confirmKey, &confirmKeys); + KeyFromPspButton(cancelKey, &cancelKeys); + KeyFromPspButton(CTRL_LTRIGGER, &tabLeft); + KeyFromPspButton(CTRL_RTRIGGER, &tabRight); // Push several hard-coded keys before submitting to native. - const keycode_t hardcodedConfirmKeys[] = { - NKCODE_SPACE, - NKCODE_ENTER, + const KeyDef hardcodedConfirmKeys[] = { + KeyDef(DEVICE_ID_KEYBOARD, NKCODE_SPACE), + KeyDef(DEVICE_ID_KEYBOARD, NKCODE_ENTER), }; // If they're not already bound, add them in. @@ -318,9 +318,9 @@ void UpdateConfirmCancelKeys() { confirmKeys.push_back(hardcodedConfirmKeys[i]); } - const keycode_t hardcodedCancelKeys[] = { - NKCODE_ESCAPE, - NKCODE_BACK, + const KeyDef hardcodedCancelKeys[] = { + KeyDef(DEVICE_ID_KEYBOARD, NKCODE_ESCAPE), + KeyDef(DEVICE_ID_KEYBOARD, NKCODE_BACK), }; for (size_t i = 0; i < ARRAY_SIZE(hardcodedCancelKeys); i++) {