summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-09-21 22:29:12 (UTC)
committer llornkcor <llornkcor>2002-09-21 22:29:12 (UTC)
commitd9910f33f40afb465164fb434677d6641272623d (patch) (side-by-side diff)
tree075b1078724d54fa7f5bbcd69d0b5a66f1205543
parentb570ab8d46fc134f16d5959861869e36af50bd38 (diff)
downloadopie-d9910f33f40afb465164fb434677d6641272623d.zip
opie-d9910f33f40afb465164fb434677d6641272623d.tar.gz
opie-d9910f33f40afb465164fb434677d6641272623d.tar.bz2
dont send keyRegister message if keycode is 0, or key is released
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/desktop.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index bca95b2..4640a12 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -380,100 +380,101 @@ void DesktopApplication::desktopMessage( const QCString &msg, const QByteArray &
void DesktopApplication::systemMessage( const QCString & msg, const QByteArray & data )
{
#ifdef Q_WS_QWS
QDataStream stream ( data, IO_ReadOnly );
if ( msg == "setScreenSaverInterval(int)" ) {
int time;
stream >> time;
m_screensaver-> setInterval( time );
}
else if ( msg == "setScreenSaverIntervals(int,int,int)" ) {
int t1, t2, t3;
stream >> t1 >> t2 >> t3;
m_screensaver-> setIntervals( t1, t2, t3 );
}
else if ( msg == "setBacklight(int)" ) {
int bright;
stream >> bright;
m_screensaver-> setBacklight( bright );
}
else if ( msg == "setScreenSaverMode(int)" ) {
int mode;
stream >> mode;
m_screensaver-> setMode ( mode );
}
#endif
}
enum MemState { Unknown, VeryLow, Low, Normal } memstate = Unknown;
#ifdef Q_WS_QWS
bool DesktopApplication::qwsEventFilter( QWSEvent *e )
{
qpedesktop->checkMemory();
if ( e->type == QWSEvent::Key ) {
QWSKeyEvent * ke = ( QWSKeyEvent * ) e;
if ( !loggedin && ke->simpleData.keycode != Key_F34 )
return TRUE;
bool press = ke->simpleData.is_press;
bool autoRepeat = ke->simpleData.is_auto_repeat;
/*
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.
will not send multiple repeats if user holds key
i.e. one shot
*/
- if ( !keyRegisterList.isEmpty() ) {
+ if ( !keyRegisterList.isEmpty() && ke->simpleData.keycode !=0 && press) {
+// qDebug("<<<<<<<<<<<<<keycode %d", ke->simpleData.keycode);
KeyRegisterList::Iterator it;
for ( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) {
- if ( ( *it ).getKeyCode() == ke->simpleData.keycode && !autoRepeat && !keyboardGrabbed() && press ) {
+ if ( ( *it ).getKeyCode() == ke->simpleData.keycode && !autoRepeat && !keyboardGrabbed() ) {
if ( press )
qDebug( "press" );
else
qDebug( "release" );
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_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 ) {