summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-06-23 20:19:27 (UTC)
committer llornkcor <llornkcor>2002-06-23 20:19:27 (UTC)
commite611ad323de0bc155d52704545378c948bdbadfa (patch) (unidiff)
tree1f7e109526722dda80261a9ec1bfe79926f1389f
parent7b861d2f14bdb50558863354522dee7c7a9ef34d (diff)
downloadopie-e611ad323de0bc155d52704545378c948bdbadfa.zip
opie-e611ad323de0bc155d52704545378c948bdbadfa.tar.gz
opie-e611ad323de0bc155d52704545378c948bdbadfa.tar.bz2
fix for keyboard handling under certain conditions, like when grabkeyboard is requested by a user app, so apps such as konsole will have proper keyboard input.
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
@@ -194,14 +194,20 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e )
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 }
@@ -750,35 +756,35 @@ void Desktop::rereadVolumes()
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}