author | groucho <groucho> | 2003-03-22 09:21:03 (UTC) |
---|---|---|
committer | groucho <groucho> | 2003-03-22 09:21:03 (UTC) |
commit | f462ccd5ad11da7bddfa627d4773e3b02f18e2b8 (patch) (unidiff) | |
tree | ba1250690fe416d01802059117107391fecb0d88 | |
parent | 32458f9d70e8b13a7e8ff46c06af17860c218f23 (diff) | |
download | opie-f462ccd5ad11da7bddfa627d4773e3b02f18e2b8.zip opie-f462ccd5ad11da7bddfa627d4773e3b02f18e2b8.tar.gz opie-f462ccd5ad11da7bddfa627d4773e3b02f18e2b8.tar.bz2 |
Bug fix- Key presess are now routed up to the QPEApplication event queue if ignore is defined for a certain key
-rw-r--r-- | core/launcher/desktop.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index fbcce7c..86527f6 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp | |||
@@ -349,12 +349,15 @@ bool DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keyc | |||
349 | m_button_timer-> stop ( ); | 349 | m_button_timer-> stop ( ); |
350 | 350 | ||
351 | if (!db-> pressedAction ( ). channel ( ) .isEmpty()) | 351 | if (!db-> pressedAction ( ). channel ( ) .isEmpty()) |
352 | { | 352 | { |
353 | |||
353 | if ( db-> pressedAction ( ). channel ( )!="ignore") { | 354 | if ( db-> pressedAction ( ). channel ( )!="ignore") { |
355 | |||
354 | db-> pressedAction ( ). send ( ); | 356 | db-> pressedAction ( ). send ( ); |
355 | } | 357 | } |
356 | else return false; | 358 | else |
359 | return false; | ||
357 | } | 360 | } |
358 | } | 361 | } |
359 | else if ( press && !autoRepeat ) { | 362 | else if ( press && !autoRepeat ) { |
360 | m_button_timer-> stop ( ); | 363 | m_button_timer-> stop ( ); |
@@ -373,15 +376,17 @@ bool DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keyc | |||
373 | } | 376 | } |
374 | 377 | ||
375 | bool DesktopApplication::eventFilter ( QObject *o, QEvent *e ) | 378 | bool DesktopApplication::eventFilter ( QObject *o, QEvent *e ) |
376 | { | 379 | { |
380 | |||
377 | if ( e-> type ( ) == QEvent::KeyPress || e-> type ( ) == QEvent::KeyRelease ) { | 381 | if ( e-> type ( ) == QEvent::KeyPress || e-> type ( ) == QEvent::KeyRelease ) { |
378 | QKeyEvent *ke = (QKeyEvent *) e; | 382 | QKeyEvent *ke = (QKeyEvent *) e; |
379 | 383 | ||
380 | const ODeviceButton *db = ODevice::inst ( )-> buttonForKeycode ( ke-> key ( )); | 384 | const ODeviceButton *db = ODevice::inst ( )-> buttonForKeycode ( ke-> key ( )); |
381 | 385 | ||
382 | if ( db ) { | 386 | if ( db ) { |
383 | return checkButtonAction ( db, ke-> key ( ), e-> type ( ) == QEvent::KeyPress, ke-> isAutoRepeat ( )); | 387 | if (checkButtonAction ( db, ke-> key ( ), e-> type ( ) == QEvent::KeyPress, ke-> isAutoRepeat ( ))) |
388 | return true; //checkButtonAction retrune false if events should be routed through | ||
384 | } | 389 | } |
385 | } | 390 | } |
386 | return QPEApplication::eventFilter ( o, e ); | 391 | return QPEApplication::eventFilter ( o, e ); |
387 | } | 392 | } |
@@ -664,10 +669,8 @@ void Desktop::execAutoStart() | |||
664 | void Desktop::togglePower() | 669 | void Desktop::togglePower() |
665 | { | 670 | { |
666 | static bool excllock = false; | 671 | static bool excllock = false; |
667 | 672 | ||
668 | qDebug ( "togglePower (locked == %d)", excllock ? 1 : 0 ); | ||
669 | |||
670 | if ( excllock ) | 673 | if ( excllock ) |
671 | return ; | 674 | return ; |
672 | 675 | ||
673 | excllock = true; | 676 | excllock = true; |