summaryrefslogtreecommitdiffstats
path: root/gui/objects.hpp
diff options
context:
space:
mode:
authorVojtech Bocek <vbocek@gmail.com>2014-03-13 17:36:52 +0100
committerGerrit Code Review <gerrit2@gerrit>2014-04-16 17:51:17 +0200
commit0b7fe504dc93246957aee38c0d93ea1fa1580fab (patch)
tree77a4471931591355c383074c480b91d8b71840e5 /gui/objects.hpp
parentAdd additional search path for brightness (diff)
downloadandroid_bootable_recovery-0b7fe504dc93246957aee38c0d93ea1fa1580fab.tar
android_bootable_recovery-0b7fe504dc93246957aee38c0d93ea1fa1580fab.tar.gz
android_bootable_recovery-0b7fe504dc93246957aee38c0d93ea1fa1580fab.tar.bz2
android_bootable_recovery-0b7fe504dc93246957aee38c0d93ea1fa1580fab.tar.lz
android_bootable_recovery-0b7fe504dc93246957aee38c0d93ea1fa1580fab.tar.xz
android_bootable_recovery-0b7fe504dc93246957aee38c0d93ea1fa1580fab.tar.zst
android_bootable_recovery-0b7fe504dc93246957aee38c0d93ea1fa1580fab.zip
Diffstat (limited to '')
-rw-r--r--gui/objects.hpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/gui/objects.hpp b/gui/objects.hpp
index 4942cd7e6..02417154a 100644
--- a/gui/objects.hpp
+++ b/gui/objects.hpp
@@ -25,6 +25,7 @@
#include <vector>
#include <string>
#include <map>
+#include <set>
#include <time.h>
extern "C" {
@@ -101,7 +102,7 @@ public:
// NotifyKey - Notify of a key press
// Return 0 on success (and consume key), >0 to pass key to next handler, and <0 on error
- virtual int NotifyKey(int key) { return 1; }
+ virtual int NotifyKey(int key, bool down) { return 1; }
// GetRenderPos - Returns the current position of the object
virtual int GetActionPos(int& x, int& y, int& w, int& h) { x = mActionX; y = mActionY; w = mActionW; h = mActionH; return 0; }
@@ -269,7 +270,7 @@ public:
public:
virtual int NotifyTouch(TOUCH_STATE state, int x, int y);
- virtual int NotifyKey(int key);
+ virtual int NotifyKey(int key, bool down);
virtual int NotifyVarChange(const std::string& varName, const std::string& value);
virtual int doActions();
@@ -282,7 +283,7 @@ protected:
};
std::vector<Action> mActions;
- int mKey;
+ std::map<int, bool> mKeys;
protected:
int getKeyByName(std::string key);
@@ -927,6 +928,11 @@ public:
virtual int KeyDown(int key_code);
virtual int KeyUp(int key_code);
virtual int KeyRepeat(void);
+
+ void ConsumeKeyRelease(int key);
+
+private:
+ std::set<int> mPressedKeys;
};
class GUISliderValue: public GUIObject, public RenderObject, public ActionObject