From 59f878a3c4d1c44be6abe336a3fff7a4a2a37b6e Mon Sep 17 00:00:00 2001 From: The Dax Date: Thu, 22 Aug 2013 13:06:12 -0400 Subject: [PATCH] Add space as a confirm key, and use a loop for hard-coded confirm keys, too. --- Common/KeyMap.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Common/KeyMap.cpp b/Common/KeyMap.cpp index e2ae8a3612..98ca6f1b2d 100644 --- a/Common/KeyMap.cpp +++ b/Common/KeyMap.cpp @@ -224,16 +224,22 @@ void UpdateConfirmCancelKeys() { } // Push several hard-coded keys before submitting to native. - if(std::find(confirmKeys.begin(), confirmKeys.end(), NKCODE_ENTER) == confirmKeys.end()) - confirmKeys.push_back(NKCODE_ENTER); + const keycode_t hardcodedConfirmKeys[] = { + NKCODE_SPACE, + NKCODE_ENTER, + }; + + // If they're not already bound, add them in. + for(int i = 0; i < ARRAY_SIZE(hardcodedConfirmKeys); i++) { + if(std::find(confirmKeys.begin(), confirmKeys.end(), hardcodedConfirmKeys[i]) == confirmKeys.end()) + confirmKeys.push_back(hardcodedConfirmKeys[i]); + } const keycode_t hardcodedCancelKeys[] = { - NKCODE_SPACE, NKCODE_ESCAPE, NKCODE_BACK, }; - // If they're not already bound, add them in. for(int i = 0; i < ARRAY_SIZE(hardcodedCancelKeys); i++) { if(std::find(cancelKeys.begin(), cancelKeys.end(), hardcodedCancelKeys[i]) == cancelKeys.end()) cancelKeys.push_back(hardcodedCancelKeys[i]);