-rw-r--r-- | core/launcher/desktop.cpp | 25 | ||||
-rw-r--r-- | core/launcher/desktop.h | 2 |
2 files changed, 18 insertions, 9 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index 59f2aea..fbcce7c 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp @@ -333,54 +333,63 @@ void DesktopApplication::launcherMessage( const QCString & msg, const QByteArray } void DesktopApplication::sendHeldAction ( ) { if ( m_last_button ) { m_last_button-> heldAction ( ). send ( ); m_last_button = 0; } } -void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keycode*/, bool press, bool autoRepeat ) +bool DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keycode*/, bool press, bool autoRepeat ) { if ( db ) { if ( !press && !autoRepeat && m_button_timer-> isActive ( )) { m_button_timer-> stop ( ); - if ( !db-> pressedAction ( ). channel ( ). isEmpty ( )) { - db-> pressedAction ( ). send ( ); + + if (!db-> pressedAction ( ). channel ( ) .isEmpty()) + { + if ( db-> pressedAction ( ). channel ( )!="ignore") { + db-> pressedAction ( ). send ( ); + } + else return false; } } else if ( press && !autoRepeat ) { m_button_timer-> stop ( ); + if (!db-> pressedAction ( ). channel ( ) .isEmpty()) + { - if ( !db-> heldAction ( ). channel ( ). isEmpty ( )) { - m_last_button = db; - m_button_timer-> start ( ODevice::inst ( )-> buttonHoldTime ( ), true ); + if ( db-> heldAction ( ). channel ( )!="ignore") { + m_last_button = db; + m_button_timer-> start ( ODevice::inst ( )-> buttonHoldTime ( ), true ); + } + else return false; } } } + return true; } bool DesktopApplication::eventFilter ( QObject *o, QEvent *e ) { if ( e-> type ( ) == QEvent::KeyPress || e-> type ( ) == QEvent::KeyRelease ) { QKeyEvent *ke = (QKeyEvent *) e; const ODeviceButton *db = ODevice::inst ( )-> buttonForKeycode ( ke-> key ( )); if ( db ) { - checkButtonAction ( db, ke-> key ( ), e-> type ( ) == QEvent::KeyPress, ke-> isAutoRepeat ( )); - return true; + return checkButtonAction ( db, ke-> key ( ), e-> type ( ) == QEvent::KeyPress, ke-> isAutoRepeat ( )); } } return QPEApplication::eventFilter ( o, e ); } #ifdef Q_WS_QWS bool DesktopApplication::qwsEventFilter( QWSEvent *e ) { qpedesktop->checkMemory(); if ( e->type == QWSEvent::Key ) { diff --git a/core/launcher/desktop.h b/core/launcher/desktop.h index db0173e..4024c38 100644 --- a/core/launcher/desktop.h +++ b/core/launcher/desktop.h @@ -74,25 +74,25 @@ protected: public slots: virtual void systemMessage ( const QCString &msg, const QByteArray &data ); virtual void launcherMessage ( const QCString &msg, const QByteArray &data ); void rereadVolumes(); protected slots: void shutdown ( ShutdownImpl::Type ); void apmTimeout ( ); void sendHeldAction ( ); protected: virtual bool eventFilter ( QObject *o, QEvent *e ); - void checkButtonAction ( const Opie::ODeviceButton *db, int keycode, bool press, bool autoRepeat ); + bool checkButtonAction ( const Opie::ODeviceButton *db, int keycode, bool press, bool autoRepeat ); private: static DesktopApplication *me ( ); private: void reloadPowerWarnSettings(); DesktopPowerAlerter *pa; PowerStatus *m_ps, *m_ps_last; QTimer *cardSendTimer; QCopChannel *channel; OpieScreenSaver *m_screensaver; QTimer * m_apm_timer; |