-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 16 |
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 | |||
@@ -444,44 +444,50 @@ void MainWindow::slotSessionChanged( Session* ses ) { | |||
444 | m_disconnect->setEnabled( false ); | 444 | m_disconnect->setEnabled( false ); |
445 | } | 445 | } |
446 | } | 446 | } |
447 | } | 447 | } |
448 | 448 | ||
449 | void MainWindow::slotFullscreen() { | 449 | void MainWindow::slotFullscreen() { |
450 | 450 | ||
451 | if ( m_isFullscreen ) { | 451 | if ( m_isFullscreen ) { |
452 | ( m_curSession->widgetStack() )->reparent( m_consoleWindow, 0, QPoint(0,0), false ); | 452 | ( m_curSession->widgetStack() )->reparent( m_consoleWindow, 0, QPoint(0,0), false ); |
453 | ( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken ); | 453 | ( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken ); |
454 | setCentralWidget( m_consoleWindow ); | 454 | setCentralWidget( m_consoleWindow ); |
455 | ( m_curSession->widgetStack() )->show(); | 455 | ( m_curSession->widgetStack() )->show(); |
456 | ( m_curSession->emulationHandler() )->cornerButton()->hide(); | 456 | ( m_curSession->emulationHandler() )->cornerButton()->hide(); |
457 | disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); | 457 | disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); |
458 | 458 | ||
459 | } else { | 459 | } else { |
460 | ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame ); | 460 | ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame ); |
461 | ( m_curSession->widgetStack() )->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop | 461 | ( m_curSession->widgetStack() )->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop |
462 | , QPoint(0,0), false ); | 462 | , QPoint(0,0), false ); |
463 | ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() ); | 463 | ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() ); |
464 | ( m_curSession->widgetStack() )->setFocus(); | 464 | ( m_curSession->widgetStack() )->setFocus(); |
465 | ( m_curSession->widgetStack() )->show(); | 465 | ( m_curSession->widgetStack() )->show(); |
466 | 466 | ||
467 | ( ( m_curSession->emulationHandler() )->cornerButton() )->show(); | 467 | ( ( m_curSession->emulationHandler() )->cornerButton() )->show(); |
468 | 468 | ||
469 | connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); | 469 | connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); |
470 | } | 470 | } |
471 | 471 | ||
472 | m_isFullscreen = !m_isFullscreen; | 472 | m_isFullscreen = !m_isFullscreen; |
473 | } | 473 | } |
474 | 474 | ||
475 | 475 | ||
476 | void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool, bool) { | 476 | void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool pressed, bool) { |
477 | 477 | ||
478 | qWarning("received key event! relay to TE widget"); | 478 | qWarning("unicode: %x, qkey: %x, %s", u, q, pressed ? "pressed" : "released"); |
479 | 479 | ||
480 | if ( m_curSession ) { | 480 | if ( m_curSession ) { |
481 | QKeyEvent ke(QEvent::KeyPress, q, u, 0); | ||
482 | 481 | ||
483 | ke.ignore(); | 482 | QEvent::Type state; |
483 | |||
484 | if (pressed) state = QEvent::KeyPress; | ||
485 | else state = QEvent::KeyRelease; | ||
486 | |||
487 | QKeyEvent ke(state, q, u, 0, QString(QChar(u))); | ||
488 | |||
484 | // where should i send this event? doesnt work sending it here | 489 | // where should i send this event? doesnt work sending it here |
485 | QApplication::sendEvent((QObject *)m_curSession->widgetStack(), &ke); | 490 | QApplication::sendEvent((QObject *)m_curSession->widget(), &ke); |
491 | ke.ignore(); | ||
486 | } | 492 | } |
487 | } | 493 | } |