summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (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
@@ -452,36 +452,42 @@ void MainWindow::slotFullscreen() {
( m_curSession->widgetStack() )->reparent( m_consoleWindow, 0, QPoint(0,0), false );
( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken );
setCentralWidget( m_consoleWindow );
( m_curSession->widgetStack() )->show();
( m_curSession->emulationHandler() )->cornerButton()->hide();
disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
} else {
( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame );
( m_curSession->widgetStack() )->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop
, QPoint(0,0), false );
( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() );
( m_curSession->widgetStack() )->setFocus();
( m_curSession->widgetStack() )->show();
( ( m_curSession->emulationHandler() )->cornerButton() )->show();
connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
}
m_isFullscreen = !m_isFullscreen;
}
-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();
}
}