diff options
Diffstat (limited to 'gui/pages.cpp')
-rw-r--r-- | gui/pages.cpp | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/gui/pages.cpp b/gui/pages.cpp index 4a65c69e4..c097c39bd 100644 --- a/gui/pages.cpp +++ b/gui/pages.cpp @@ -584,15 +584,13 @@ int Page::NotifyKey(int key, bool down) { std::vector<ActionObject*>::reverse_iterator iter; - // Don't try to handle a lack of handlers - 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++) { ret = (*iter)->NotifyKey(key, down); + if (ret == 0) + return 0; if (ret < 0) { LOGERR("An action handler has returned an error\n"); ret = 1; @@ -601,22 +599,18 @@ int Page::NotifyKey(int key, bool down) return ret; } -int Page::NotifyKeyboard(int key) +int Page::NotifyCharInput(int ch) { std::vector<InputObject*>::reverse_iterator iter; - // Don't try to handle a lack of handlers - if (mInputs.size() == 0) - return 1; - // We work backwards, from top-most element to bottom-most element for (iter = mInputs.rbegin(); iter != mInputs.rend(); iter++) { - int ret = (*iter)->NotifyKeyboard(key); + int ret = (*iter)->NotifyCharInput(ch); if (ret == 0) return 0; else if (ret < 0) - LOGERR("A keyboard handler has returned an error"); + LOGERR("A char input handler has returned an error"); } return 1; } @@ -625,10 +619,6 @@ int Page::SetKeyBoardFocus(int inFocus) { std::vector<InputObject*>::reverse_iterator iter; - // Don't try to handle a lack of handlers - if (mInputs.size() == 0) - return 1; - // We work backwards, from top-most element to bottom-most element for (iter = mInputs.rbegin(); iter != mInputs.rend(); iter++) { @@ -1155,12 +1145,12 @@ int PageSet::NotifyKey(int key, bool down) return (mCurrentPage ? mCurrentPage->NotifyKey(key, down) : -1); } -int PageSet::NotifyKeyboard(int key) +int PageSet::NotifyCharInput(int ch) { if (!mOverlays.empty()) - return mOverlays.back()->NotifyKeyboard(key); + return mOverlays.back()->NotifyCharInput(ch); - return (mCurrentPage ? mCurrentPage->NotifyKeyboard(key) : -1); + return (mCurrentPage ? mCurrentPage->NotifyCharInput(ch) : -1); } int PageSet::SetKeyBoardFocus(int inFocus) @@ -1654,9 +1644,9 @@ int PageManager::NotifyKey(int key, bool down) return (mCurrentSet ? mCurrentSet->NotifyKey(key, down) : -1); } -int PageManager::NotifyKeyboard(int key) +int PageManager::NotifyCharInput(int ch) { - return (mCurrentSet ? mCurrentSet->NotifyKeyboard(key) : -1); + return (mCurrentSet ? mCurrentSet->NotifyCharInput(ch) : -1); } int PageManager::SetKeyBoardFocus(int inFocus) |