From 8bbd3bca858939b15b8775b4811149b8d83bb6cc Mon Sep 17 00:00:00 2001 From: llornkcor Date: Sun, 20 Oct 2002 23:00:49 +0000 Subject: better implementation of F11 menu handling --- (limited to 'core/launcher/desktop.cpp') diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index 9863187..387650b 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp @@ -476,10 +476,10 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e ) return TRUE; } // menu key now opens application menu/toolbar - if ( ke->simpleData.keycode == Key_F11 ) { - if ( press ) emit menu(); - return TRUE; - } +// if ( ke->simpleData.keycode == Key_F11 ) { +// if ( press ) emit menu(); +// return TRUE; +// } if ( ke->simpleData.keycode == Key_F12 ) { while ( activePopupWidget() ) @@ -1047,3 +1047,18 @@ void Desktop::soundAlarm() ODevice::inst ( ) -> alarmSound ( ); } +bool Desktop::eventFilter( QObject *, QEvent *ev ) +{ + if ( ev->type() == QEvent::KeyPress ) { + QKeyEvent *ke = (QKeyEvent *)ev; + if ( ke->key() == Qt::Key_F11 ) { // menu key + QWidget *active = qApp->activeWindow(); + if ( active && active->isPopup() ) { + active->close(); + } + raiseMenu(); + return TRUE; + } + } + return FALSE; +} -- cgit v0.9.0.2