summaryrefslogtreecommitdiff
path: root/library/qpemenubar.cpp
authorsandman <sandman>2002-12-22 23:59:13 (UTC)
committer sandman <sandman>2002-12-22 23:59:13 (UTC)
commitc513f413c7d901cc9945714c8e7eb47292f63306 (patch) (unidiff)
tree9ce6af28225f006dffbeb536eb2fd520e903e08d /library/qpemenubar.cpp
parent5c7694a7baadec8afe128ad2541e0a8acfc23737 (diff)
downloadopie-c513f413c7d901cc9945714c8e7eb47292f63306.zip
opie-c513f413c7d901cc9945714c8e7eb47292f63306.tar.gz
opie-c513f413c7d901cc9945714c8e7eb47292f63306.tar.bz2
Totally reworked the key grabbing, which always had problems:
- applications get *all* key events now, as long as they have the focus - an application decides if it has the keyboard grabbed or not - if it's grabbed, the app consumes the key press - if it's not grabbed and a F1-F29 key is pressed, the app sends a QCop call to the launcher (deviceButtonPressed(...)) - when the launcher receives a QCop deviceButtonPressed it simply sends the configured QCopEnvelope - all "special" actions (like menu, home) are now accessible via QCop calls (see buttonsettings)
Diffstat (limited to 'library/qpemenubar.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpemenubar.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/library/qpemenubar.cpp b/library/qpemenubar.cpp
index 4aa0bf3..3e5bad5 100644
--- a/library/qpemenubar.cpp
+++ b/library/qpemenubar.cpp
@@ -216,28 +216,24 @@ bool QPEMenuToolFocusManager::eventFilter( QObject *object, QEvent *event )
216 mb->goodbye(); 216 mb->goodbye();
217 moveFocus( FALSE ); 217 moveFocus( FALSE );
218 return TRUE; 218 return TRUE;
219 } 219 }
220 QMenuItem *mi = mb->findItem( mb->idAt(i) ); 220 QMenuItem *mi = mb->findItem( mb->idAt(i) );
221 if ( mi->isEnabled() && !mi->isSeparator() ) { 221 if ( mi->isEnabled() && !mi->isSeparator() ) {
222 break; 222 break;
223 } 223 }
224 } 224 }
225 } 225 }
226 } 226 }
227 } 227 }
228 if ( ke->key() == Key_F11 ) {
229 setActive( !isActive() );
230 return TRUE;
231 }
232 } else if ( event->type() == QEvent::KeyRelease ) { 228 } else if ( event->type() == QEvent::KeyRelease ) {
233 QKeyEvent *ke = (QKeyEvent *)event; 229 QKeyEvent *ke = (QKeyEvent *)event;
234 if ( isActive() ) { 230 if ( isActive() ) {
235 if ( object->inherits( "QButton" ) ) { 231 if ( object->inherits( "QButton" ) ) {
236 // Deactivate when a button is selected 232 // Deactivate when a button is selected
237 if ( ke->key() == Key_Space ) 233 if ( ke->key() == Key_Space )
238 QTimer::singleShot( 0, this, SLOT(deactivate()) ); 234 QTimer::singleShot( 0, this, SLOT(deactivate()) );
239 } 235 }
240 } 236 }
241 } else if ( event->type() == QEvent::FocusIn ) { 237 } else if ( event->type() == QEvent::FocusIn ) {
242 if ( isActive() ) { 238 if ( isActive() ) {
243 // A non-menu/tool widget has been selected - we're deactivated 239 // A non-menu/tool widget has been selected - we're deactivated