Summary: | Special Keys button in full screen mode | ||
---|---|---|---|
Product: | [Applications] krdc | Reporter: | chris-kde |
Component: | general | Assignee: | Urs Wolfer <uwolfer> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
chris-kde
2005-07-06 03:18:17 UTC
SVN commit 699338 by uwolfer: Implement new send-special-keys-to-remote-desktop action. This way the user can send for example already used shortcuts to the remote desktop without execute them on the local machine. This action is now also available in the remote view toolbar (fullscreen toolbar). BUG: 108619 M +1 -0 CMakeLists.txt M +2 -0 krdcui.rc M +16 -0 mainwindow.cpp M +1 -0 mainwindow.h M +1 -1 remoteview.cpp M +3 -7 remoteview.h A specialkeysdialog.cpp [License: GPL (v2+)] A specialkeysdialog.h [License: GPL (v2+)] M +11 -8 vnc/vncview.cpp M +1 -1 vnc/vncview.h --- trunk/KDE/kdenetwork/krdc/CMakeLists.txt #699337:699338 @@ -45,6 +45,7 @@ config/preferencesdialog.cpp floatingtoolbar.cpp bookmarkmanager.cpp + specialkeysdialog.cpp remoteview.cpp mainwindow.cpp main.cpp --- trunk/KDE/kdenetwork/krdc/krdcui.rc #699337:699338 @@ -13,6 +13,7 @@ <Action name="take_screenshot" /> <Action name="view_only" /> <Action name="show_local_cursor" /> + <Action name="special_keys_dialog" /> <Action name="logout" /> </Menu> <Action name="bookmark" /> @@ -33,6 +34,7 @@ <Action name="switch_fullscreen" /> <Action name="take_screenshot" /> <Action name="view_only" /> + <Action name="special_keys_dialog" /> <Action name="logout" /> </ToolBar> <ToolBar fullWidth="false" name="krdc_address_toolbar" newline="false"><text>Address Toolbar</text> --- trunk/KDE/kdenetwork/krdc/mainwindow.cpp #699337:699338 @@ -28,6 +28,7 @@ #include "config/preferencesdialog.h" #include "floatingtoolbar.h" #include "bookmarkmanager.h" +#include "specialkeysdialog.h" #ifdef BUILD_RDP #include "rdpview.h" #endif @@ -141,6 +142,11 @@ showLocalCursorAction->setText(i18n("S&how Local Cursor")); connect(showLocalCursorAction, SIGNAL(triggered(bool)), SLOT(slotShowLocalCursor(bool))); + QAction *specialKeysDialogAction = actionCollection()->addAction("special_keys_dialog"); + specialKeysDialogAction->setIcon(KIcon("browser-go")); + specialKeysDialogAction->setText(i18n("Open Special Keys Dialog...")); + connect(specialKeysDialogAction, SIGNAL(triggered()), SLOT(slotSpecialKeyDialog())); + QAction *quitAction = KStandardAction::quit(this, SLOT(slotQuit()), actionCollection()); actionCollection()->addAction("quit", quitAction); QAction *preferencesAction = KStandardAction::preferences(this, SLOT(slotPreferences()), actionCollection()); @@ -437,6 +443,14 @@ m_remoteViewList.at(m_currentRemoteView)->setViewOnly(viewOnly); } +void MainWindow::slotSpecialKeyDialog() +{ + kDebug(5010) << "slotSpecialKeyDialog"; + + SpecialKeysDialog dialog(this, m_remoteViewList.at(m_currentRemoteView)); + dialog.exec(); +} + void MainWindow::showRemoteViewToolbar() { kDebug(5010) << "showRemoteViewToolbar"; @@ -453,6 +467,7 @@ m_toolBar->addAction(actionCollection()->action("take_screenshot")); m_toolBar->addAction(actionCollection()->action("view_only")); m_toolBar->addAction(actionCollection()->action("show_local_cursor")); + m_toolBar->addAction(actionCollection()->action("special_keys_dialog")); m_toolBar->addAction(actionCollection()->action("logout")); QAction *stickToolBarAction = new QAction(m_toolBar); @@ -482,6 +497,7 @@ actionCollection()->action("switch_fullscreen")->setEnabled(enabled); actionCollection()->action("take_screenshot")->setEnabled(enabled); actionCollection()->action("view_only")->setEnabled(enabled); + actionCollection()->action("special_keys_dialog")->setEnabled(enabled); actionCollection()->action("logout")->setEnabled(enabled); bool viewOnlyChecked = false; --- trunk/KDE/kdenetwork/krdc/mainwindow.h #699337:699338 @@ -68,6 +68,7 @@ void slotLogout(); void slotViewOnly(bool viewOnly); void slotShowLocalCursor(bool showLocalCursor); + void slotSpecialKeyDialog(); void updateActionStatus(); void updateConfiguration(); void tabChanged(int index); --- trunk/KDE/kdenetwork/krdc/remoteview.cpp #699337:699338 @@ -111,7 +111,7 @@ return m_port; } -void RemoteView::pressKey(XEvent *) +void RemoteView::keyEvent(QKeyEvent *event) { } --- trunk/KDE/kdenetwork/krdc/remoteview.h #699337:699338 @@ -30,10 +30,6 @@ #include <QWidget> -#ifndef Q_WS_X11 -class XEvent; -#endif - /** * Generic widget that displays a remote framebuffer. * Implement this if you want to add another backend. @@ -273,10 +269,10 @@ virtual void switchFullscreen(bool on); /** - * Sends a key to the remote server. - * @param k the key to send + * Sends a QKeyEvent to the remote server. + * @param event the key to send */ - virtual void pressKey(XEvent *k); + virtual void keyEvent(QKeyEvent *event); signals: /** --- trunk/KDE/kdenetwork/krdc/vnc/vncview.cpp #699337:699338 @@ -226,8 +226,8 @@ // kDebug(5011) << "event->reason() == Qt::TabFocusReason"; event->ignore(); setFocus(); // get focus back and send tab key event to remote desktop - keyEvent(new QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier), true); - keyEvent(new QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier), false); + keyEvent(new QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier)); + keyEvent(new QKeyEvent(QEvent::KeyRelease, Qt::Key_Tab, Qt::NoModifier)); } event->accept(); @@ -310,7 +310,7 @@ event->accept(); } -void VncView::keyEvent(QKeyEvent *e, bool pressed) +void VncView::keyEvent(QKeyEvent *e) { rfbKeySym k = 0; switch (e->key()) { @@ -370,23 +370,26 @@ rfbClientLog("Unknown keysym: %d\n", e->key()); } - vncThread.keyEvent(k, pressed); + if (k < 26) // workaround for modified keys by pressing CTRL + k += 96; + + vncThread.keyEvent(k, (e->type() == QEvent::KeyPress) ? true : false); } void VncView::keyPressEvent(QKeyEvent *event) { -// kDebug(5011) << "key press"; +// kDebug(5011) << "key press" << event->key(); - keyEvent(event, true); + keyEvent(event); event->accept(); } void VncView::keyReleaseEvent(QKeyEvent *event) { -// kDebug(5011) << "key release"; +// kDebug(5011) << "key release" << event->key(); - keyEvent(event, false); + keyEvent(event); event->accept(); } --- trunk/KDE/kdenetwork/krdc/vnc/vncview.h #699337:699338 @@ -49,6 +49,7 @@ bool isQuitting(); bool start(); bool supportsLocalCursor() const; + void keyEvent(QKeyEvent *e); protected: void paintEvent(QPaintEvent *event); @@ -76,7 +77,6 @@ void updateImage(int x, int y, int w, int h); void requestPassword(); void mouseEvent(QMouseEvent *event); - void keyEvent(QKeyEvent *e, bool pressed); }; #endif |