summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp23
-rw-r--r--core/launcher/desktop.h1
2 files changed, 20 insertions, 4 deletions
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
@@ -455,52 +455,52 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e )
QCopEnvelope( ( *it ).getChannel().utf8(), ( *it ).getMessage().utf8() );
}
}
}
if ( !keyboardGrabbed() ) {
if ( ke->simpleData.keycode == Key_F9 ) {
if ( press )
emit datebook();
return TRUE;
}
if ( ke->simpleData.keycode == Key_F10 ) {
if ( !press && cardSendTimer ) {
emit contacts();
delete cardSendTimer;
}
else if ( press ) {
cardSendTimer = new QTimer();
cardSendTimer->start( 2000, TRUE );
connect( cardSendTimer, SIGNAL( timeout() ), this, SLOT( sendCard() ) );
}
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() )
activePopupWidget() ->close();
if ( press )
emit launch();
return TRUE;
}
if ( ke->simpleData.keycode == Key_F13 ) {
if ( press )
emit email();
return TRUE;
}
}
if ( ke->simpleData.keycode == Key_F34 ) {
if ( press )
emit power();
return TRUE;
}
// This was used for the iPAQ PowerButton
// See main.cpp for new KeyboardFilter
//
// if ( ke->simpleData.keycode == Key_SysReq ) {
@@ -1026,24 +1026,39 @@ void Desktop::rereadVolumes()
cfg.setGroup( "Volume" );
touchclick = cfg.readBoolEntry( "TouchSound" );
keyclick = cfg.readBoolEntry( "KeySound" );
alarmsound = cfg.readBoolEntry( "AlarmSound" );
}
void Desktop::keyClick()
{
if ( keyclick )
ODevice::inst ( ) -> keySound ( );
}
void Desktop::screenClick()
{
if ( touchclick )
ODevice::inst ( ) -> touchSound ( );
}
void Desktop::soundAlarm()
{
if ( qpedesktop-> alarmsound )
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;
+}
diff --git a/core/launcher/desktop.h b/core/launcher/desktop.h
index 5de85f4..04c2f61 100644
--- a/core/launcher/desktop.h
+++ b/core/launcher/desktop.h
@@ -104,44 +104,45 @@ public:
void screenClick();
static void soundAlarm();
public slots:
void raiseDatebook();
void raiseContacts();
void raiseMenu();
void raiseLauncher();
void raiseEmail();
void execAutoStart();
void togglePower();
void toggleLight();
void toggleNumLockState();
void toggleCapsLockState();
void toggleSymbolInput();
void terminateServers();
void rereadVolumes();
void home ( );
protected:
void executeOrModify( const QString& appLnkFile );
void styleChange( QStyle & );
void timerEvent( QTimerEvent *e );
+ bool eventFilter( QObject *, QEvent * );
QWidget *bg;
Launcher *launcher;
TaskBar *tb;
private:
void startTransferServer();
bool recoverMemory();
QCopBridge *qcopBridge;
TransferServer *transferServer;
PackageSlave *packageSlave;
QDateTime suspendTime;
bool keyclick, touchclick, alarmsound;
};
#endif // __DESKTOP_H__