summaryrefslogtreecommitdiff
path: root/noncore
authorhash <hash>2002-10-17 18:03:39 (UTC)
committer hash <hash>2002-10-17 18:03:39 (UTC)
commit43aecbd7095da335158b461a9ce293d236cd32ab (patch) (unidiff)
tree43fbfa93d33ae3308f3aec8f5bb5c00d2505f64a /noncore
parent08e9fcbbaf57383fd65fe4eb197d97a51abe0f26 (diff)
downloadopie-43aecbd7095da335158b461a9ce293d236cd32ab.zip
opie-43aecbd7095da335158b461a9ce293d236cd32ab.tar.gz
opie-43aecbd7095da335158b461a9ce293d236cd32ab.tar.bz2
function keyboard should work now. here is a sample opie-console-keys.conf file
[keys] r0c0 = F1|4144|0 r0c1 = F2|4145|0 r0c2 = F3|4146|0 r0c3 = F4|4147|0 r0c4 = F5|4148|0 r0c5 = F6|4149|0 r0c6 = ESC|4096|0 r0c7 = A|65|65 r0c8 = a|65|97 r0c9 = PgUp|4118|0 r0c10 = PgDn|4119|0
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index fdb0452..f0130e1 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -470,18 +470,24 @@ void MainWindow::slotFullscreen() {
470 } 470 }
471 471
472 m_isFullscreen = !m_isFullscreen; 472 m_isFullscreen = !m_isFullscreen;
473} 473}
474 474
475 475
476void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool, bool) { 476void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool pressed, bool) {
477 477
478 qWarning("received key event! relay to TE widget"); 478 qWarning("unicode: %x, qkey: %x, %s", u, q, pressed ? "pressed" : "released");
479 479
480 if ( m_curSession ) { 480 if ( m_curSession ) {
481 QKeyEvent ke(QEvent::KeyPress, q, u, 0);
482 481
483 ke.ignore(); 482 QEvent::Type state;
483
484 if (pressed) state = QEvent::KeyPress;
485 else state = QEvent::KeyRelease;
486
487 QKeyEvent ke(state, q, u, 0, QString(QChar(u)));
488
484 // where should i send this event? doesnt work sending it here 489 // where should i send this event? doesnt work sending it here
485 QApplication::sendEvent((QObject *)m_curSession->widgetStack(), &ke); 490 QApplication::sendEvent((QObject *)m_curSession->widget(), &ke);
491 ke.ignore();
486 } 492 }
487} 493}