summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index d0e9613..040b2fe 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -1103,54 +1103,56 @@ bool QPEApplication::qwsEventFilter( QWSEvent * e )
1103 else if ( ( ( HackWidget * ) active ) ->needsOk() ) { 1103 else if ( ( ( HackWidget * ) active ) ->needsOk() ) {
1104 QSignal s; 1104 QSignal s;
1105 s.connect( active, SLOT( accept() ) ); 1105 s.connect( active, SLOT( accept() ) );
1106 s.activate(); 1106 s.activate();
1107 } 1107 }
1108 else { 1108 else {
1109 // do the same as with the select key: Map to the default action of the widget: 1109 // do the same as with the select key: Map to the default action of the widget:
1110 mapToDefaultAction( ke, Qt::Key_Return ); 1110 mapToDefaultAction( ke, Qt::Key_Return );
1111 } 1111 }
1112 } 1112 }
1113 } 1113 }
1114 } 1114 }
1115 else if ( ke->simpleData.keycode == Qt::Key_F30 ) { 1115 else if ( ke->simpleData.keycode == Qt::Key_F30 ) {
1116 // Use special "select" key to do whatever default action a widget has 1116 // Use special "select" key to do whatever default action a widget has
1117 mapToDefaultAction( ke, Qt::Key_Space ); 1117 mapToDefaultAction( ke, Qt::Key_Space );
1118 } 1118 }
1119 else if ( ke->simpleData.keycode == Qt::Key_Escape && 1119 else if ( ke->simpleData.keycode == Qt::Key_Escape &&
1120 ke->simpleData.is_press ) { 1120 ke->simpleData.is_press ) {
1121 // Escape key closes app if focus on toplevel 1121 // Escape key closes app if focus on toplevel
1122 QWidget * active = activeWindow(); 1122 QWidget * active = activeWindow();
1123 if ( active && active->testWFlags( WType_TopLevel ) && 1123 if ( active && active->testWFlags( WType_TopLevel ) &&
1124 ( int ) active->winId() == ke->simpleData.window && 1124 ( int ) active->winId() == ke->simpleData.window &&
1125 !active->testWFlags( WStyle_Dialog | WStyle_Customize | WType_Popup | WType_Desktop ) ) { 1125 !active->testWFlags( WStyle_Dialog | WStyle_Customize | WType_Popup | WType_Desktop ) ) {
1126 if ( active->inherits( "QDialog" ) ) { 1126 if ( active->inherits( "QDialog" ) ) {
1127 qDebug("dialog hack");
1128 HackDialog * d = ( HackDialog * ) active; 1127 HackDialog * d = ( HackDialog * ) active;
1129 d->rejectIt(); 1128 d->rejectIt();
1130 return TRUE; 1129 return TRUE;
1130 } else /*if ( strcmp( argv() [ 0 ], "embeddedkonsole" ) != 0 )*/ {
1131 active->close();
1131 } 1132 }
1132 } 1133 }
1134
1133 } 1135 }
1134 else if ( ke->simpleData.keycode >= Qt::Key_F1 && ke->simpleData.keycode <= Qt::Key_F29 ) { 1136 else if ( ke->simpleData.keycode >= Qt::Key_F1 && ke->simpleData.keycode <= Qt::Key_F29 ) {
1135 // this should be if ( ODevice::inst ( )-> buttonForKeycode ( ... )) 1137 // this should be if ( ODevice::inst ( )-> buttonForKeycode ( ... ))
1136 // but we cannot access libopie function within libqpe :( 1138 // but we cannot access libopie function within libqpe :(
1137 1139
1138 QWidget * active = activeWindow ( ); 1140 QWidget * active = activeWindow ( );
1139 if ( active && ((int) active-> winId ( ) == ke-> simpleData.window )) { 1141 if ( active && ((int) active-> winId ( ) == ke-> simpleData.window )) {
1140 if ( d-> kbgrabbed ) { // we grabbed the keyboard 1142 if ( d-> kbgrabbed ) { // we grabbed the keyboard
1141 QChar ch ( ke-> simpleData.unicode ); 1143 QChar ch ( ke-> simpleData.unicode );
1142 QKeyEvent qke ( ke-> simpleData. is_press ? QEvent::KeyPress : QEvent::KeyRelease, 1144 QKeyEvent qke ( ke-> simpleData. is_press ? QEvent::KeyPress : QEvent::KeyRelease,
1143 ke-> simpleData.keycode, 1145 ke-> simpleData.keycode,
1144 ch. latin1 ( ), 1146 ch. latin1 ( ),
1145 ke-> simpleData.modifiers, 1147 ke-> simpleData.modifiers,
1146 QString ( ch ), 1148 QString ( ch ),
1147 ke-> simpleData.is_auto_repeat, 1 ); 1149 ke-> simpleData.is_auto_repeat, 1 );
1148 1150
1149 QObject *which = QWidget::keyboardGrabber ( ); 1151 QObject *which = QWidget::keyboardGrabber ( );
1150 if ( !which ) 1152 if ( !which )
1151 which = QApplication::focusWidget ( ); 1153 which = QApplication::focusWidget ( );
1152 if ( !which ) 1154 if ( !which )
1153 which = QApplication::activeWindow ( ); 1155 which = QApplication::activeWindow ( );
1154 if ( !which ) 1156 if ( !which )
1155 which = qApp; 1157 which = qApp;
1156 1158