From 43aecbd7095da335158b461a9ce293d236cd32ab Mon Sep 17 00:00:00 2001 From: hash Date: Thu, 17 Oct 2002 18:03:39 +0000 Subject: 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 --- (limited to 'noncore/apps/opie-console') 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 @@ -473,15 +473,21 @@ void MainWindow::slotFullscreen() { } -void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool, bool) { +void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool pressed, bool) { - qWarning("received key event! relay to TE widget"); + qWarning("unicode: %x, qkey: %x, %s", u, q, pressed ? "pressed" : "released"); if ( m_curSession ) { - QKeyEvent ke(QEvent::KeyPress, q, u, 0); - ke.ignore(); + QEvent::Type state; + + if (pressed) state = QEvent::KeyPress; + else state = QEvent::KeyRelease; + + QKeyEvent ke(state, q, u, 0, QString(QChar(u))); + // where should i send this event? doesnt work sending it here - QApplication::sendEvent((QObject *)m_curSession->widgetStack(), &ke); + QApplication::sendEvent((QObject *)m_curSession->widget(), &ke); + ke.ignore(); } } -- cgit v0.9.0.2