summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-06-23 20:19:27 (UTC)
committer llornkcor <llornkcor>2002-06-23 20:19:27 (UTC)
commite611ad323de0bc155d52704545378c948bdbadfa (patch) (side-by-side diff)
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
@@ -185,32 +185,38 @@ 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;
- if (!keyRegisterList.isEmpty())
- {
+
+ /*
+ 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()) {
KeyRegisterList::Iterator it;
- for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it )
- {
- if ((*it).getKeyCode() == ke->simpleData.keycode && !autoRepeat) {
- if(press) qDebug("press"); else qDebug("release");
- QCopEnvelope((*it).getChannel().utf8(), (*it).getMessage().utf8());
+ for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) {
+ 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();
@@ -741,44 +747,44 @@ void Desktop::rereadVolumes()
cfg.setGroup("Volume");
touchclick = cfg.readBoolEntry("TouchSound");
keyclick = cfg.readBoolEntry("KeySound");
alarmsound = cfg.readBoolEntry("AlarmSound");
// Config cfg("Sound");
// cfg.setGroup("System");
// touchclick = cfg.readBoolEntry("Touch");
// keyclick = cfg.readBoolEntry("Key");
}
void Desktop::keyClick()
{
- if ( keyclick )
- ODevice::inst ( )-> keySound ( );
+ if ( keyclick )
+ ODevice::inst ( )-> keySound ( );
}
void Desktop::screenClick()
{
- if ( touchclick )
- ODevice::inst ( )-> touchSound ( );
+ if ( touchclick )
+ ODevice::inst ( )-> touchSound ( );
}
void Desktop::soundAlarm()
{
- if ( qpedesktop-> alarmsound )
- ODevice::inst ( )-> alarmSound ( );
+ if ( qpedesktop-> alarmsound )
+ ODevice::inst ( )-> alarmSound ( );
}
bool Desktop::eventFilter( QObject *, QEvent *ev )
{
- if ( ev-> type ( ) == QEvent::KeyPress ) {
- QKeyEvent *ke = (QKeyEvent *) ev;
- if ( ke-> key ( ) == Qt::Key_F11 ) { // menu key
- QWidget *active = qApp-> activeWindow ( );
-
- if ( active && active-> isPopup ( ))
- active->close();
-
- raiseMenu ( );
- return true;
- }
- }
- return false;
+ if ( ev-> type ( ) == QEvent::KeyPress ) {
+ QKeyEvent *ke = (QKeyEvent *) ev;
+ if ( ke-> key ( ) == Qt::Key_F11 ) { // menu key
+ QWidget *active = qApp-> activeWindow ( );
+
+ if ( active && active-> isPopup ( ))
+ active->close();
+
+ raiseMenu ( );
+ return true;
+ }
+ }
+ return false;
}