Diffstat (limited to 'noncore/apps/opie-console/main.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/main.cpp | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/main.cpp b/noncore/apps/opie-console/main.cpp index eafc9b2..58c9c57 100644 --- a/noncore/apps/opie-console/main.cpp +++ b/noncore/apps/opie-console/main.cpp @@ -1,8 +1,39 @@ -#include <opie2/oapplicationfactory.h> +#include <opie2/oapplication.h> +#include <qwsevent_qws.h> #include "mainwindow.h" +class OConsoleApplication : public Opie::Core::OApplication { +public: + OConsoleApplication(int argc, char* argv[]); +protected: + bool qwsEventFilter( QWSEvent * ); +}; -OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<MainWindow> ); +OConsoleApplication::OConsoleApplication(int argc, char* argv[] ) + : Opie::Core::OApplication(argc, argv, "opie-console") +{} +bool OConsoleApplication::qwsEventFilter( QWSEvent *e) { + if( e->type == QWSEvent::Key ) { + QWSKeyEvent *key = static_cast<QWSKeyEvent*>(e); + + /* prevent QPEApplication to filter the key */ + if(key->simpleData.keycode == Qt::Key_Escape) + return QApplication::qwsEventFilter(e); + + } + + return Opie::Core::OApplication::qwsEventFilter( e); +} + + +int main(int argc, char* argv[]) { + OConsoleApplication app(argc, argv); + + MainWindow win; + app.showMainWidget(&win); + + return app.exec(); +} |