diff --git a/module-apps/application-call/windows/CallWindow.cpp b/module-apps/application-call/windows/CallWindow.cpp index 8eb59e9cb..64f0b2f87 100644 --- a/module-apps/application-call/windows/CallWindow.cpp +++ b/module-apps/application-call/windows/CallWindow.cpp @@ -367,14 +367,9 @@ bool CallWindow::onInput( const InputEvent& inputEvent ) { application->refreshWindow( RefreshModes::GUI_REFRESH_FAST); return true; } - else if( AppWindow::onInput( inputEvent ) ) { //check if any of the lower inheritance onInput methods catch the event - //refresh window only when key is other than enter - if( inputEvent.keyCode != KeyCode::KEY_ENTER ) - application->render( RefreshModes::GUI_REFRESH_FAST ); - return true; - } - return false; + //check if any of the lower inheritance onInput methods catch the event + return AppWindow::onInput( inputEvent ); } } /* namespace gui */ diff --git a/module-apps/application-call/windows/EnterNumberWindow.cpp b/module-apps/application-call/windows/EnterNumberWindow.cpp index b71574f6e..8535a061f 100644 --- a/module-apps/application-call/windows/EnterNumberWindow.cpp +++ b/module-apps/application-call/windows/EnterNumberWindow.cpp @@ -125,9 +125,7 @@ bool EnterNumberWindow::onInput( const InputEvent& inputEvent ) { } //check if any of the lower inheritance onInput methods catch the event - if( AppWindow::onInput( inputEvent ) ) return true; - - return false; + return AppWindow::onInput( inputEvent ); } bool EnterNumberWindow::handleSwitchData( SwitchData* data ) { diff --git a/module-apps/application-desktop/windows/DesktopMainWindow.cpp b/module-apps/application-desktop/windows/DesktopMainWindow.cpp index 66af336db..071f899bc 100644 --- a/module-apps/application-desktop/windows/DesktopMainWindow.cpp +++ b/module-apps/application-desktop/windows/DesktopMainWindow.cpp @@ -219,9 +219,7 @@ bool DesktopMainWindow::onInput( const InputEvent& inputEvent ) { } //check if any of the lower inheritance onInput methods catch the event - if( AppWindow::onInput( inputEvent ) ) return true; - - return false; + return AppWindow::onInput( inputEvent ); } void DesktopMainWindow::rebuild() { diff --git a/module-apps/application-desktop/windows/MenuWindow.cpp b/module-apps/application-desktop/windows/MenuWindow.cpp index ffcf7a071..415e55ac0 100644 --- a/module-apps/application-desktop/windows/MenuWindow.cpp +++ b/module-apps/application-desktop/windows/MenuWindow.cpp @@ -212,12 +212,7 @@ bool MenuWindow::onInput( const InputEvent& inputEvent ) { } //check if any of the lower inheritance onInput methods catch the event - if( AppWindow::onInput( inputEvent ) ) { - application->render( RefreshModes::GUI_REFRESH_FAST ); - return true; - } - - return false; + return AppWindow::onInput( inputEvent ); } void MenuWindow::switchPage( uint32_t index ) { diff --git a/module-apps/application-desktop/windows/PinLockWindow.cpp b/module-apps/application-desktop/windows/PinLockWindow.cpp index 741f8676c..6fc784914 100644 --- a/module-apps/application-desktop/windows/PinLockWindow.cpp +++ b/module-apps/application-desktop/windows/PinLockWindow.cpp @@ -276,9 +276,7 @@ bool PinLockWindow::onInput( const InputEvent& inputEvent ) { } //check if any of the lower inheritance onInput methods catch the event - if( AppWindow::onInput( inputEvent ) ) return true; - - return false; + return AppWindow::onInput( inputEvent ); } } /* namespace gui */ diff --git a/module-apps/application-desktop/windows/PowerOffWindow.cpp b/module-apps/application-desktop/windows/PowerOffWindow.cpp index cd87f60d8..4972f60c9 100644 --- a/module-apps/application-desktop/windows/PowerOffWindow.cpp +++ b/module-apps/application-desktop/windows/PowerOffWindow.cpp @@ -191,8 +191,7 @@ void PowerOffWindow::onBeforeShow( ShowMode mode, SwitchData* data ) { bool PowerOffWindow::onInput( const InputEvent& inputEvent ) { //check if any of the lower inheritance onInput methods catch the event - if( AppWindow::onInput( inputEvent ) ) { - application->render(RefreshModes::GUI_REFRESH_FAST); + if( AppWindow::onInput( inputEvent ) ) { // TODO: alek: test it return true; } diff --git a/module-apps/application-messages/windows/MessagesMainWindow.cpp b/module-apps/application-messages/windows/MessagesMainWindow.cpp index faf24a986..176d34358 100644 --- a/module-apps/application-messages/windows/MessagesMainWindow.cpp +++ b/module-apps/application-messages/windows/MessagesMainWindow.cpp @@ -104,15 +104,7 @@ void MessagesMainWindow::onBeforeShow(ShowMode mode, SwitchData *data) { bool MessagesMainWindow::onInput(const InputEvent &inputEvent) { //check if any of the lower inheritance onInput methods catch the event - if( AppWindow::onInput( inputEvent ) ) { - //refresh window only when key is other than enter - if( inputEvent.keyCode != KeyCode::KEY_ENTER ) - application->render( RefreshModes::GUI_REFRESH_FAST ); - return true; - } - - return false; - + return AppWindow::onInput( inputEvent ); } bool MessagesMainWindow::onDatabaseMessage( sys::Message* msgl ) { diff --git a/module-apps/application-messages/windows/ThreadViewWindow.cpp b/module-apps/application-messages/windows/ThreadViewWindow.cpp index a9270263d..55b9a9ec7 100644 --- a/module-apps/application-messages/windows/ThreadViewWindow.cpp +++ b/module-apps/application-messages/windows/ThreadViewWindow.cpp @@ -85,16 +85,7 @@ void ThreadViewWindow::onBeforeShow(ShowMode mode, SwitchData *data) { } bool ThreadViewWindow::onInput(const InputEvent &inputEvent) { - //check if any of the lower inheritance onInput methods catch the event - if( AppWindow::onInput( inputEvent ) ) { - //refresh window only when key is other than enter - if( inputEvent.keyCode != KeyCode::KEY_ENTER ) - application->render( RefreshModes::GUI_REFRESH_FAST ); - return true; - } - - return false; - + return AppWindow::onInput( inputEvent ); } bool ThreadViewWindow::onDatabaseMessage( sys::Message* msgl ) { diff --git a/module-apps/application-notes/windows/NotesEditWindow.cpp b/module-apps/application-notes/windows/NotesEditWindow.cpp index e9f9fe4d8..d19872ac1 100644 --- a/module-apps/application-notes/windows/NotesEditWindow.cpp +++ b/module-apps/application-notes/windows/NotesEditWindow.cpp @@ -97,19 +97,6 @@ void NotesEditWindow::onBeforeShow( ShowMode mode, SwitchData* data ) { setFocusItem( text ); } -bool NotesEditWindow::onInput( const InputEvent& inputEvent ) { - //check if any of the lower inheritance onInput methods catch the event - if( AppWindow::onInput( inputEvent ) ) { - //refresh window only when key is other than enter - if( inputEvent.keyCode != KeyCode::KEY_ENTER ) { - application->render( RefreshModes::GUI_REFRESH_FAST ); - } - return true; - } - - return false; -} - } /* namespace gui */ diff --git a/module-apps/application-notes/windows/NotesEditWindow.hpp b/module-apps/application-notes/windows/NotesEditWindow.hpp index 2bdf9372a..c7a062879 100644 --- a/module-apps/application-notes/windows/NotesEditWindow.hpp +++ b/module-apps/application-notes/windows/NotesEditWindow.hpp @@ -31,7 +31,6 @@ public: virtual ~NotesEditWindow(); //virtual methods - bool onInput( const InputEvent& inputEvent ) override; void onBeforeShow( ShowMode mode, SwitchData* data ) override; void rebuild() override; diff --git a/module-apps/application-notes/windows/NotesMainWindow.cpp b/module-apps/application-notes/windows/NotesMainWindow.cpp index f9f5b49c9..ab8bbdbe5 100644 --- a/module-apps/application-notes/windows/NotesMainWindow.cpp +++ b/module-apps/application-notes/windows/NotesMainWindow.cpp @@ -85,28 +85,16 @@ void NotesMainWindow::onBeforeShow( ShowMode mode, SwitchData* data ) { } bool NotesMainWindow::onInput( const InputEvent& inputEvent ) { - //check if any of the lower inheritance onInput methods catch the event - if( AppWindow::onInput( inputEvent ) ) { - //refresh window only when key is other than enter - if( inputEvent.keyCode != KeyCode::KEY_ENTER ) - application->render( RefreshModes::GUI_REFRESH_FAST ); - return true; - } //process only if key is released - if(( inputEvent.state != InputEvent::State::keyReleasedShort ) && - (( inputEvent.state != InputEvent::State::keyReleasedLong ))) - return false; - - if( inputEvent.keyCode == KeyCode::KEY_ENTER ) { - LOG_INFO("Enter pressed"); - } - else if( inputEvent.keyCode == KeyCode::KEY_LEFT ) { - application->switchWindow( "EditWindow" ); - return true; + if(( inputEvent.state != InputEvent::State::keyReleasedShort ) || ( inputEvent.state != InputEvent::State::keyReleasedLong )) { + if( inputEvent.keyCode == KeyCode::KEY_LEFT ) { + application->switchWindow( "EditWindow" ); + return true; + } } - return false; + return AppWindow::onInput( inputEvent ); } bool NotesMainWindow::onDatabaseMessage( sys::Message* msgl ) { diff --git a/module-apps/application-phonebook/windows/PhonebookMainWindow.cpp b/module-apps/application-phonebook/windows/PhonebookMainWindow.cpp index 03ace0c1c..5c487f703 100644 --- a/module-apps/application-phonebook/windows/PhonebookMainWindow.cpp +++ b/module-apps/application-phonebook/windows/PhonebookMainWindow.cpp @@ -178,16 +178,8 @@ bool PhonebookMainWindow::onInput(const InputEvent &inputEvent) { } } - //check if any of the lower inheritance onInput methods catch the event - if( AppWindow::onInput( inputEvent ) ) { - //refresh window only when key is other than enter - if( inputEvent.keyCode != KeyCode::KEY_ENTER ) - application->render( RefreshModes::GUI_REFRESH_FAST ); - return true; - } - - return false; + return AppWindow::onInput( inputEvent ); } diff --git a/module-apps/application-settings/windows/LanguageWindow.cpp b/module-apps/application-settings/windows/LanguageWindow.cpp index fff981907..2465f7b38 100644 --- a/module-apps/application-settings/windows/LanguageWindow.cpp +++ b/module-apps/application-settings/windows/LanguageWindow.cpp @@ -123,16 +123,4 @@ void LanguageWindow::onBeforeShow( ShowMode mode, SwitchData* data ) { setFocusItem( options[0] ); } -bool LanguageWindow::onInput( const InputEvent& inputEvent ) { - //check if any of the lower inheritance onInput methods catch the event - if( AppWindow::onInput( inputEvent ) ) { - //refresh window only when key is other than enter - if( inputEvent.keyCode != KeyCode::KEY_ENTER ) - application->render( RefreshModes::GUI_REFRESH_FAST ); - return true; - } - - return false; -} - } /* namespace gui */ diff --git a/module-apps/application-settings/windows/LanguageWindow.hpp b/module-apps/application-settings/windows/LanguageWindow.hpp index 1f26444ad..36dee972c 100644 --- a/module-apps/application-settings/windows/LanguageWindow.hpp +++ b/module-apps/application-settings/windows/LanguageWindow.hpp @@ -35,7 +35,6 @@ public: virtual ~LanguageWindow(); //virtual methods - bool onInput( const InputEvent& inputEvent ) override; void onBeforeShow( ShowMode mode, SwitchData* data ) override; void rebuild() override; diff --git a/module-apps/application-settings/windows/SettingsMainWindow.cpp b/module-apps/application-settings/windows/SettingsMainWindow.cpp index 590f5f2fe..ed413e335 100644 --- a/module-apps/application-settings/windows/SettingsMainWindow.cpp +++ b/module-apps/application-settings/windows/SettingsMainWindow.cpp @@ -128,16 +128,5 @@ void SettingsMainWindow::onBeforeShow( ShowMode mode, SwitchData* data ) { setFocusItem( options[0] ); } -bool SettingsMainWindow::onInput( const InputEvent& inputEvent ) { - //check if any of the lower inheritance onInput methods catch the event - if( AppWindow::onInput( inputEvent ) ) { - //refresh window only when key is other than enter - if( inputEvent.keyCode != KeyCode::KEY_ENTER ) - application->render( RefreshModes::GUI_REFRESH_FAST ); - return true; - } - - return false; -} } /* namespace gui */ diff --git a/module-apps/application-settings/windows/SettingsMainWindow.hpp b/module-apps/application-settings/windows/SettingsMainWindow.hpp index 07999ed99..5a6758b75 100644 --- a/module-apps/application-settings/windows/SettingsMainWindow.hpp +++ b/module-apps/application-settings/windows/SettingsMainWindow.hpp @@ -35,7 +35,6 @@ public: virtual ~SettingsMainWindow(); //virtual methods - bool onInput( const InputEvent& inputEvent ) override; void onBeforeShow( ShowMode mode, SwitchData* data ) override; void rebuild() override; diff --git a/module-apps/windows/AppWindow.cpp b/module-apps/windows/AppWindow.cpp index a458cb1c2..0047a0fba 100644 --- a/module-apps/windows/AppWindow.cpp +++ b/module-apps/windows/AppWindow.cpp @@ -104,7 +104,10 @@ bool AppWindow::onDatabaseMessage( sys::Message* msg ){ return false; } bool AppWindow::onInput( const InputEvent& inputEvent) { //check if any of the lower inheritance onInput methods catch the event - if( Window::onInput( inputEvent ) ) return true; + if( Window::onInput( inputEvent ) ) { + if( inputEvent.keyCode != KeyCode::KEY_ENTER ) application->render( RefreshModes::GUI_REFRESH_FAST ); + return true; + } //process only if key is released if(( inputEvent.state != InputEvent::State::keyReleasedShort )) return false;