summaryrefslogtreecommitdiff
path: root/core/launcher/desktop.cpp
Side-by-side diff
Diffstat (limited to 'core/launcher/desktop.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/desktop.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 59f2aea..fbcce7c 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -321,78 +321,87 @@ void DesktopApplication::launcherMessage( const QCString & msg, const QByteArray
const ODeviceButton *db = ODevice::inst ( )-> buttonForKeycode ( keycode );
if ( db )
checkButtonAction ( db, keycode, press, autoRepeat );
}
else if ( msg == "keyRegister(int,QCString,QCString)" ) {
int k;
QCString c, m;
stream >> k >> c >> m;
keyRegisterList.append ( QCopKeyRegister ( k, c, m ));
}
}
void DesktopApplication::sendHeldAction ( )
{
if ( m_last_button ) {
m_last_button-> heldAction ( ). send ( );
m_last_button = 0;
}
}
-void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keycode*/, bool press, bool autoRepeat )
+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 ( ) .isEmpty())
+ {
+ if ( db-> pressedAction ( ). channel ( )!="ignore") {
db-> pressedAction ( ). send ( );
}
+ else return false;
+ }
}
else if ( press && !autoRepeat ) {
m_button_timer-> stop ( );
+ if (!db-> pressedAction ( ). channel ( ) .isEmpty())
+ {
- if ( !db-> heldAction ( ). 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 ) {
- checkButtonAction ( db, ke-> key ( ), e-> type ( ) == QEvent::KeyPress, ke-> isAutoRepeat ( ));
- return true;
+ return checkButtonAction ( db, ke-> key ( ), e-> type ( ) == QEvent::KeyPress, ke-> isAutoRepeat ( ));
}
}
return QPEApplication::eventFilter ( o, e );
}
#ifdef Q_WS_QWS
bool DesktopApplication::qwsEventFilter( QWSEvent *e )
{
qpedesktop->checkMemory();
if ( e->type == QWSEvent::Key ) {
QWSKeyEvent * ke = (QWSKeyEvent *) e;
ushort keycode = ke-> simpleData. keycode;
if ( !loggedin && keycode != Key_F34 )
return true;
bool press = ke-> simpleData. is_press;
bool autoRepeat = ke-> simpleData. is_auto_repeat;
if ( !keyboardGrabbed ( )) {
// app that registers key/message to be sent back to the app, when it doesn't have focus,
// when user presses key, unless keyboard has been requested from app.