From d0cd09e4a68ca8dc3acf50c13a0acce39cd36b55 Mon Sep 17 00:00:00 2001 From: hash Date: Tue, 15 Oct 2002 16:25:43 +0000 Subject: added a keyReceive slot so sending key events to the TE widget _might_ be possible (havent figure that out yet...) --- (limited to 'noncore/apps') diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 29dbcf3..d3b6c8a 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -205,6 +205,8 @@ void MainWindow::initUI() { m_keyBar->hide(); m_kb = new FunctionKeyboard(m_keyBar); + connect(m_kb, SIGNAL(keyPressed(ushort, ushort, bool, bool, bool)), + this, SLOT(slotKeyReceived(ushort, ushort, bool, bool, bool))); @@ -476,3 +478,17 @@ void MainWindow::slotFullscreen() { m_isFullscreen = !m_isFullscreen; } + + +void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool, bool) { + + qWarning("received key event! relay to TE widget"); + + if ( m_curSession ) { + QKeyEvent ke(QEvent::KeyPress, q, u, 0); + + ke.ignore(); + // where should i send this event? doesnt work sending it here + QApplication::sendEvent((QObject *)m_curSession->widgetStack(), &ke); + } +} diff --git a/noncore/apps/opie-console/mainwindow.h b/noncore/apps/opie-console/mainwindow.h index e63078a..91ca147 100644 --- a/noncore/apps/opie-console/mainwindow.h +++ b/noncore/apps/opie-console/mainwindow.h @@ -64,6 +64,8 @@ private slots: void slotRunScript(); void slotFullscreen(); void slotSessionChanged( Session* ); + void slotKeyReceived(ushort, ushort, bool, bool, bool); + private: void initUI(); void populateProfiles(); -- cgit v0.9.0.2