Add space as a confirm key, and use a loop for hard-coded confirm keys, too.

This commit is contained in:
The Dax committed 2013-08-22 13:06:12 -04:00
1 parent 4beef2b877
commit 59f878a3c4
1 file changed
+10 -4
+10 -4
View File
@@ -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]);