Add support for actions triggered by key combination

Change-Id: I9dfa7de40229f00412d63fc9c1eb3a809a6eb2e6
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
diff --git a/gui/pages.cpp b/gui/pages.cpp
index 2953edd..398224e 100644
--- a/gui/pages.cpp
+++ b/gui/pages.cpp
@@ -55,6 +55,7 @@
 PageSet* PageManager::mCurrentSet;
 PageSet* PageManager::mBaseSet = NULL;
 MouseCursor *PageManager::mMouseCursor = NULL;
+HardwareKeyboard *PageManager::mHardwareKeyboard = NULL;
 
 // Helper routine to convert a string to a color declaration
 int ConvertStrToColor(std::string str, COLOR* color)
@@ -447,7 +448,7 @@
 	return ret;
 }
 
-int Page::NotifyKey(int key)
+int Page::NotifyKey(int key, bool down)
 {
 	std::vector<ActionObject*>::reverse_iterator iter;
 
@@ -455,16 +456,17 @@
 	if (mActions.size() == 0)
 		return 1;
 
+	int ret = 1;
 	// We work backwards, from top-most element to bottom-most element
 	for (iter = mActions.rbegin(); iter != mActions.rend(); iter++)
 	{
-		int ret = (*iter)->NotifyKey(key);
-		if (ret == 0)
-			return 0;
-		else if (ret < 0)
-			LOGERR("An action handler has returned an error");
+		ret = (*iter)->NotifyKey(key, down);
+		if (ret < 0) {
+			LOGERR("An action handler has returned an error\n");
+			ret = 1;
+		}
 	}
-	return 1;
+	return ret;
 }
 
 int Page::NotifyKeyboard(int key)
@@ -719,12 +721,12 @@
 	return (mCurrentPage ? mCurrentPage->NotifyTouch(state, x, y) : -1);
 }
 
-int PageSet::NotifyKey(int key)
+int PageSet::NotifyKey(int key, bool down)
 {
 	if (mOverlayPage)
-		return (mOverlayPage->NotifyKey(key));
+		return (mOverlayPage->NotifyKey(key, down));
 
-	return (mCurrentPage ? mCurrentPage->NotifyKey(key) : -1);
+	return (mCurrentPage ? mCurrentPage->NotifyKey(key, down) : -1);
 }
 
 int PageSet::NotifyKeyboard(int key)
@@ -964,6 +966,13 @@
 	return res;
 }
 
+HardwareKeyboard *PageManager::GetHardwareKeyboard()
+{
+	if(!mHardwareKeyboard)
+		mHardwareKeyboard = new HardwareKeyboard();
+	return mHardwareKeyboard;
+}
+
 MouseCursor *PageManager::GetMouseCursor()
 {
 	if(!mMouseCursor)
@@ -1002,9 +1011,9 @@
 	return (mCurrentSet ? mCurrentSet->NotifyTouch(state, x, y) : -1);
 }
 
-int PageManager::NotifyKey(int key)
+int PageManager::NotifyKey(int key, bool down)
 {
-	return (mCurrentSet ? mCurrentSet->NotifyKey(key) : -1);
+	return (mCurrentSet ? mCurrentSet->NotifyKey(key, down) : -1);
 }
 
 int PageManager::NotifyKeyboard(int key)