summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp11
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
@@ -341,55 +341,60 @@ void DesktopApplication::sendHeldAction ( )
}
bool DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keycode*/, bool press, bool autoRepeat )
{
if ( db ) {
if ( !press && !autoRepeat && m_button_timer-> isActive ( )) {
m_button_timer-> stop ( );
if (!db-> pressedAction ( ). channel ( ) .isEmpty())
{
+
if ( db-> pressedAction ( ). channel ( )!="ignore") {
+
db-> pressedAction ( ). send ( );
}
- else return false;
+ else
+ return false;
}
}
else if ( press && !autoRepeat ) {
m_button_timer-> stop ( );
if (!db-> pressedAction ( ). channel ( ) .isEmpty())
{
if ( db-> heldAction ( ). channel ( )!="ignore") {
m_last_button = db;
m_button_timer-> start ( ODevice::inst ( )-> buttonHoldTime ( ), true );
}
else return false;
}
}
}
return true;
}
bool DesktopApplication::eventFilter ( QObject *o, QEvent *e )
{
+
if ( e-> type ( ) == QEvent::KeyPress || e-> type ( ) == QEvent::KeyRelease ) {
QKeyEvent *ke = (QKeyEvent *) e;
const ODeviceButton *db = ODevice::inst ( )-> buttonForKeycode ( ke-> key ( ));
if ( db ) {
- return checkButtonAction ( db, ke-> key ( ), e-> type ( ) == QEvent::KeyPress, ke-> isAutoRepeat ( ));
+ if (checkButtonAction ( db, ke-> key ( ), e-> type ( ) == QEvent::KeyPress, ke-> isAutoRepeat ( )))
+ return true; //checkButtonAction retrune false if events should be routed through
}
}
return QPEApplication::eventFilter ( o, e );
}
#ifdef Q_WS_QWS
bool DesktopApplication::qwsEventFilter( QWSEvent *e )
{
qpedesktop->checkMemory();
if ( e->type == QWSEvent::Key ) {
@@ -656,26 +661,24 @@ void Desktop::execAutoStart()
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <linux/ioctl.h>
#include <time.h>
#endif
void Desktop::togglePower()
{
static bool excllock = false;
- qDebug ( "togglePower (locked == %d)", excllock ? 1 : 0 );
-
if ( excllock )
return ;
excllock = true;
bool wasloggedin = loggedin;
loggedin = 0;
suspendTime = QDateTime::currentDateTime();
#ifdef QWS
if ( Password::needToAuthenticate ( true ) && qt_screen ) {