summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 541b4be..e58b08c 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -160,97 +160,97 @@ DesktopApplication::~DesktopApplication()
160 delete ps; 160 delete ps;
161 delete pa; 161 delete pa;
162} 162}
163 163
164void DesktopApplication::receive( const QCString &msg, const QByteArray &data ) 164void DesktopApplication::receive( const QCString &msg, const QByteArray &data )
165{ 165{
166 QDataStream stream( data, IO_ReadOnly ); 166 QDataStream stream( data, IO_ReadOnly );
167 if (msg == "keyRegister(int key, QString channel, QString message)") 167 if (msg == "keyRegister(int key, QString channel, QString message)")
168 { 168 {
169 int k; 169 int k;
170 QString c, m; 170 QString c, m;
171 stream >> k; 171 stream >> k;
172 stream >> c; 172 stream >> c;
173 stream >> m; 173 stream >> m;
174 174
175 qWarning("KeyRegisterReceived: %i, %s, %s", k, (const char*)c, (const char *)m ); 175 qWarning("KeyRegisterReceived: %i, %s, %s", k, (const char*)c, (const char *)m );
176 keyRegisterList.append(QCopKeyRegister(k,c,m)); 176 keyRegisterList.append(QCopKeyRegister(k,c,m));
177 } 177 }
178 else if (msg == "suspend()"){ 178 else if (msg == "suspend()"){
179 emit power(); 179 emit power();
180 } 180 }
181 181
182} 182}
183 183
184enum MemState { Unknown, VeryLow, Low, Normal } memstate=Unknown; 184enum 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 197
198 /* 198 /*
199 app that registers key/message to be sent back to the app, when it doesn't have focus, 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. 200 when user presses key, unless keyboard has been requested from app.
201 will not send multiple repeats if user holds key 201 will not send multiple repeats if user holds key
202 i.e. one shot 202 i.e. one shot
203 203
204 */ 204 */
205 if (!keyRegisterList.isEmpty()) { 205 if (!keyRegisterList.isEmpty()) {
206 KeyRegisterList::Iterator it; 206 KeyRegisterList::Iterator it;
207 for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) { 207 for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) {
208 if ((*it).getKeyCode() == ke->simpleData.keycode && !autoRepeat && !keyboardGrabbed()) { 208 if ((*it).getKeyCode() == ke->simpleData.keycode && !autoRepeat && !keyboardGrabbed() && press) {
209 if(press) qDebug("press"); else qDebug("release"); 209 if(press) qDebug("press"); else qDebug("release");
210 QCopEnvelope((*it).getChannel().utf8(), (*it).getMessage().utf8()); 210 QCopEnvelope((*it).getChannel().utf8(), (*it).getMessage().utf8());
211 } 211 }
212 } 212 }
213 } 213 }
214 214
215 if ( !keyboardGrabbed() ) { 215 if ( !keyboardGrabbed() ) {
216 if ( ke->simpleData.keycode == Key_F9 ) { 216 if ( ke->simpleData.keycode == Key_F9 ) {
217 if ( press ) emit datebook(); 217 if ( press ) emit datebook();
218 return TRUE; 218 return TRUE;
219 } 219 }
220 if ( ke->simpleData.keycode == Key_F10 ) { 220 if ( ke->simpleData.keycode == Key_F10 ) {
221 if ( !press && cardSendTimer ) { 221 if ( !press && cardSendTimer ) {
222 emit contacts(); 222 emit contacts();
223 delete cardSendTimer; 223 delete cardSendTimer;
224 } else if ( press ) { 224 } else if ( press ) {
225 cardSendTimer = new QTimer(); 225 cardSendTimer = new QTimer();
226 cardSendTimer->start( 2000, TRUE ); 226 cardSendTimer->start( 2000, TRUE );
227 connect( cardSendTimer, SIGNAL( timeout() ), this, SLOT( sendCard() ) ); 227 connect( cardSendTimer, SIGNAL( timeout() ), this, SLOT( sendCard() ) );
228 } 228 }
229 return TRUE; 229 return TRUE;
230 } 230 }
231 /* menu key now opens application menu/toolbar 231 /* menu key now opens application menu/toolbar
232 if ( ke->simpleData.keycode == Key_F11 ) { 232 if ( ke->simpleData.keycode == Key_F11 ) {
233 if ( press ) emit menu(); 233 if ( press ) emit menu();
234 return TRUE; 234 return TRUE;
235 } 235 }
236 */ 236 */
237 if ( ke->simpleData.keycode == Key_F12 ) { 237 if ( ke->simpleData.keycode == Key_F12 ) {
238 while( activePopupWidget() ) 238 while( activePopupWidget() )
239 activePopupWidget()->close(); 239 activePopupWidget()->close();
240 if ( press ) emit launch(); 240 if ( press ) emit launch();
241 return TRUE; 241 return TRUE;
242 } 242 }
243 if ( ke->simpleData.keycode == Key_F13 ) { 243 if ( ke->simpleData.keycode == Key_F13 ) {
244 if ( press ) emit email(); 244 if ( press ) emit email();
245 return TRUE; 245 return TRUE;
246 } 246 }
247 } 247 }
248 248
249 if ( ke->simpleData.keycode == Key_F34 ) { 249 if ( ke->simpleData.keycode == Key_F34 ) {
250 if ( press ) emit power(); 250 if ( press ) emit power();
251 return TRUE; 251 return TRUE;
252 } 252 }
253// This was used for the iPAQ PowerButton 253// This was used for the iPAQ PowerButton
254// See main.cpp for new KeyboardFilter 254// See main.cpp for new KeyboardFilter
255// 255//
256// if ( ke->simpleData.keycode == Key_SysReq ) { 256// if ( ke->simpleData.keycode == Key_SysReq ) {