summaryrefslogtreecommitdiffstats
path: root/gui/action.cpp
diff options
context:
space:
mode:
authorthat <github@that.at>2016-01-05 23:29:30 +0100
committerthat <github@that.at>2016-01-07 22:30:39 +0100
commit8834a0ffc0be61218ab86bf209cb6cd53a18a565 (patch)
tree1229c2413a373d799831f4e9c6ebe087c4c53fb5 /gui/action.cpp
parentFix translation spellings (diff)
downloadandroid_bootable_recovery-8834a0ffc0be61218ab86bf209cb6cd53a18a565.tar
android_bootable_recovery-8834a0ffc0be61218ab86bf209cb6cd53a18a565.tar.gz
android_bootable_recovery-8834a0ffc0be61218ab86bf209cb6cd53a18a565.tar.bz2
android_bootable_recovery-8834a0ffc0be61218ab86bf209cb6cd53a18a565.tar.lz
android_bootable_recovery-8834a0ffc0be61218ab86bf209cb6cd53a18a565.tar.xz
android_bootable_recovery-8834a0ffc0be61218ab86bf209cb6cd53a18a565.tar.zst
android_bootable_recovery-8834a0ffc0be61218ab86bf209cb6cd53a18a565.zip
Diffstat (limited to '')
-rw-r--r--gui/action.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/gui/action.cpp b/gui/action.cpp
index 9f746c348..656c687b9 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -292,12 +292,9 @@ int GUIAction::NotifyTouch(TOUCH_STATE state __unused, int x __unused, int y __u
int GUIAction::NotifyKey(int key, bool down)
{
- if (mKeys.empty())
- return 0;
-
std::map<int, bool>::iterator itr = mKeys.find(key);
if(itr == mKeys.end())
- return 0;
+ return 1;
bool prevState = itr->second;
itr->second = down;
@@ -312,7 +309,7 @@ int GUIAction::NotifyKey(int key, bool down)
} else if(down) {
for(itr = mKeys.begin(); itr != mKeys.end(); ++itr) {
if(!itr->second)
- return 0;
+ return 1;
}
// Passed, all req buttons are pressed, reset them and consume release events
@@ -1727,7 +1724,7 @@ int GUIAction::twcmd(std::string arg)
int GUIAction::getKeyByName(std::string key)
{
- if (key == "home") return KEY_HOME;
+ if (key == "home") return KEY_HOMEPAGE; // note: KEY_HOME is cursor movement (like KEY_END)
else if (key == "menu") return KEY_MENU;
else if (key == "back") return KEY_BACK;
else if (key == "search") return KEY_SEARCH;