-rw-r--r-- | core/launcher/serverapp.cpp | 16 | ||||
-rw-r--r-- | core/launcher/serverapp.h | 2 |
2 files changed, 15 insertions, 3 deletions
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp index 75d4ac1..6fe0479 100644 --- a/core/launcher/serverapp.cpp +++ b/core/launcher/serverapp.cpp @@ -146,3 +146,3 @@ void DesktopPowerAlerter::hideEvent( QHideEvent *e ) -KeyFilter::KeyFilter(QObject* parent) : QObject(parent), held_tid(0), heldButton(0) +KeyFilter::KeyFilter(QObject* parent) : QObject(parent), held_tid(0), heldButton(0),firedHeldButton(0) { @@ -161,2 +161,3 @@ void KeyFilter::timerEvent(QTimerEvent* e) emit activate(heldButton, TRUE); + firedHeldButton = heldButton; heldButton = 0; @@ -204,2 +205,3 @@ bool KeyFilter::checkButtonAction(bool db, int keycode, int press, int autoRepe +// odebug << " KeyFilter::checkButtonAction("<<db<<","<<keycode<<","<<press<<","<<autoRepeat<<")"<<oendl; /* check if it was registered */ @@ -209,3 +211,2 @@ bool KeyFilter::checkButtonAction(bool db, int keycode, int press, int autoRepe } else { - // First check to see if DeviceButtonManager knows something about this button: @@ -213,2 +214,3 @@ bool KeyFilter::checkButtonAction(bool db, int keycode, int press, int autoRepe if (button && !autoRepeat) { + if (firedHeldButton) { if ( held_tid ) { @@ -217,2 +219,10 @@ bool KeyFilter::checkButtonAction(bool db, int keycode, int press, int autoRepe } + if (!press && button == firedHeldButton) { + firedHeldButton = 0; + return TRUE; + } + } else if ( held_tid && heldButton != button) { + killTimer(held_tid); + held_tid = 0; + } if ( button->heldAction().isNull() ) { @@ -221,4 +231,6 @@ bool KeyFilter::checkButtonAction(bool db, int keycode, int press, int autoRepe } else if ( press ) { + if (heldButton != button) { heldButton = button; held_tid = startTimer( ODevice::inst ()->buttonHoldTime () ); + } } else if ( heldButton ) { diff --git a/core/launcher/serverapp.h b/core/launcher/serverapp.h index 27be28b..98c5633 100644 --- a/core/launcher/serverapp.h +++ b/core/launcher/serverapp.h @@ -83,3 +83,3 @@ private: int held_tid; - const Opie::Core::ODeviceButton* heldButton; + const Opie::Core::ODeviceButton* heldButton,*firedHeldButton; KeyRegisterList m_keys; |