author | hash <hash> | 2002-10-15 16:25:43 (UTC) |
---|---|---|
committer | hash <hash> | 2002-10-15 16:25:43 (UTC) |
commit | d0cd09e4a68ca8dc3acf50c13a0acce39cd36b55 (patch) (side-by-side diff) | |
tree | 7562d562c6463a9f28587af3c1138e1f780dfb3d | |
parent | 09ba4d2c79a41b185902519639032a49c85deadb (diff) | |
download | opie-d0cd09e4a68ca8dc3acf50c13a0acce39cd36b55.zip opie-d0cd09e4a68ca8dc3acf50c13a0acce39cd36b55.tar.gz opie-d0cd09e4a68ca8dc3acf50c13a0acce39cd36b55.tar.bz2 |
added a keyReceive slot so sending key events to the TE widget _might_ be possible (havent figure that out yet...)
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 16 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.h | 2 |
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 @@ -200,16 +200,18 @@ void MainWindow::initUI() { /* and the keyboard */ 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 ); m_transfer->setEnabled( false ); m_recordScript->setEnabled( false ); @@ -471,8 +473,22 @@ void MainWindow::slotFullscreen() { // need teh scrollbar // ( m_curSession->widgetStack() )->setCornerWidget( cornerButton ); 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 @@ -59,16 +59,18 @@ private slots: void slotProfile(int); void slotTransfer(); 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 */ Session* m_curSession; |