summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp58
1 files changed, 32 insertions, 26 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 7662e48..24dce73 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -185,32 +185,38 @@ enum MemState { Unknown, VeryLow, Low, Normal } memstate=Unknown;
185 185
186#ifdef Q_WS_QWS 186#ifdef Q_WS_QWS
187bool DesktopApplication::qwsEventFilter( QWSEvent *e ) 187bool DesktopApplication::qwsEventFilter( QWSEvent *e )
188{ 188{
189 qpedesktop->checkMemory(); 189 qpedesktop->checkMemory();
190 190
191 if ( e->type == QWSEvent::Key ) { 191 if ( e->type == QWSEvent::Key ) {
192 QWSKeyEvent *ke = (QWSKeyEvent *)e; 192 QWSKeyEvent *ke = (QWSKeyEvent *)e;
193 if ( !loggedin && ke->simpleData.keycode != Key_F34 ) 193 if ( !loggedin && ke->simpleData.keycode != Key_F34 )
194 return TRUE; 194 return TRUE;
195 bool press = ke->simpleData.is_press; 195 bool press = ke->simpleData.is_press;
196 bool autoRepeat= ke->simpleData.is_auto_repeat; 196 bool autoRepeat= ke->simpleData.is_auto_repeat;
197 if (!keyRegisterList.isEmpty()) 197
198 { 198 /*
199 app that registers key/message to be sent back to the app, when it doesn't have focus,
200 when user presses key, unless keyboard has been requested from app.
201 will not send multiple repeats if user holds key
202 i.e. one shot
203
204 */
205 if (!keyRegisterList.isEmpty()) {
199 KeyRegisterList::Iterator it; 206 KeyRegisterList::Iterator it;
200 for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) 207 for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) {
201 { 208 if ((*it).getKeyCode() == ke->simpleData.keycode && !autoRepeat && !keyboardGrabbed()) {
202 if ((*it).getKeyCode() == ke->simpleData.keycode && !autoRepeat) { 209 if(press) qDebug("press"); else qDebug("release");
203 if(press) qDebug("press"); else qDebug("release"); 210 QCopEnvelope((*it).getChannel().utf8(), (*it).getMessage().utf8());
204 QCopEnvelope((*it).getChannel().utf8(), (*it).getMessage().utf8());
205 } 211 }
206 } 212 }
207 } 213 }
208 214
209 if ( !keyboardGrabbed() ) { 215 if ( !keyboardGrabbed() ) {
210 if ( ke->simpleData.keycode == Key_F9 ) { 216 if ( ke->simpleData.keycode == Key_F9 ) {
211 if ( press ) emit datebook(); 217 if ( press ) emit datebook();
212 return TRUE; 218 return TRUE;
213 } 219 }
214 if ( ke->simpleData.keycode == Key_F10 ) { 220 if ( ke->simpleData.keycode == Key_F10 ) {
215 if ( !press && cardSendTimer ) { 221 if ( !press && cardSendTimer ) {
216 emit contacts(); 222 emit contacts();
@@ -741,44 +747,44 @@ void Desktop::rereadVolumes()
741 cfg.setGroup("Volume"); 747 cfg.setGroup("Volume");
742 touchclick = cfg.readBoolEntry("TouchSound"); 748 touchclick = cfg.readBoolEntry("TouchSound");
743 keyclick = cfg.readBoolEntry("KeySound"); 749 keyclick = cfg.readBoolEntry("KeySound");
744 alarmsound = cfg.readBoolEntry("AlarmSound"); 750 alarmsound = cfg.readBoolEntry("AlarmSound");
745// Config cfg("Sound"); 751// Config cfg("Sound");
746// cfg.setGroup("System"); 752// cfg.setGroup("System");
747// touchclick = cfg.readBoolEntry("Touch"); 753// touchclick = cfg.readBoolEntry("Touch");
748// keyclick = cfg.readBoolEntry("Key"); 754// keyclick = cfg.readBoolEntry("Key");
749} 755}
750 756
751void Desktop::keyClick() 757void Desktop::keyClick()
752{ 758{
753 if ( keyclick ) 759 if ( keyclick )
754 ODevice::inst ( )-> keySound ( ); 760 ODevice::inst ( )-> keySound ( );
755} 761}
756 762
757void Desktop::screenClick() 763void Desktop::screenClick()
758{ 764{
759 if ( touchclick ) 765 if ( touchclick )
760 ODevice::inst ( )-> touchSound ( ); 766 ODevice::inst ( )-> touchSound ( );
761} 767}
762 768
763void Desktop::soundAlarm() 769void Desktop::soundAlarm()
764{ 770{
765 if ( qpedesktop-> alarmsound ) 771 if ( qpedesktop-> alarmsound )
766 ODevice::inst ( )-> alarmSound ( ); 772 ODevice::inst ( )-> alarmSound ( );
767} 773}
768 774
769bool Desktop::eventFilter( QObject *, QEvent *ev ) 775bool Desktop::eventFilter( QObject *, QEvent *ev )
770{ 776{
771 if ( ev-> type ( ) == QEvent::KeyPress ) { 777 if ( ev-> type ( ) == QEvent::KeyPress ) {
772 QKeyEvent *ke = (QKeyEvent *) ev; 778 QKeyEvent *ke = (QKeyEvent *) ev;
773 if ( ke-> key ( ) == Qt::Key_F11 ) { // menu key 779 if ( ke-> key ( ) == Qt::Key_F11 ) { // menu key
774 QWidget *active = qApp-> activeWindow ( ); 780 QWidget *active = qApp-> activeWindow ( );
775 781
776 if ( active && active-> isPopup ( )) 782 if ( active && active-> isPopup ( ))
777 active->close(); 783 active->close();
778 784
779 raiseMenu ( ); 785 raiseMenu ( );
780 return true; 786 return true;
781 } 787 }
782 } 788 }
783 return false; 789 return false;
784} 790}