summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp16
-rw-r--r--noncore/apps/opie-console/mainwindow.h2
2 files changed, 18 insertions, 0 deletions
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
@@ -202,12 +202,14 @@ void MainWindow::initUI() {
m_keyBar = new QToolBar(this);
addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE );
m_keyBar->setHorizontalStretchable( TRUE );
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)));
m_connect->setEnabled( false );
m_disconnect->setEnabled( false );
m_terminate->setEnabled( false );
@@ -473,6 +475,20 @@ void MainWindow::slotFullscreen() {
m_fullscreen->setText( tr("Stop full screen") );
}
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
@@ -61,12 +61,14 @@ private slots:
void slotOpenKeb(bool);
void slotRecordScript();
void slotSaveScript();
void slotRunScript();
void slotFullscreen();
void slotSessionChanged( Session* );
+ void slotKeyReceived(ushort, ushort, bool, bool, bool);
+
private:
void initUI();
void populateProfiles();
void create( const Profile& );
/**
* the current session