1 /****************************************************************************
3 ** Copyright (C) 2007-2008 Urs Wolfer <uwolfer @ kde.org>
5 ** This file is part of KDE.
7 ** This program is free software; you can redistribute it and/or modify
8 ** it under the terms of the GNU General Public License as published by
9 ** the Free Software Foundation; either version 2 of the License, or
10 ** (at your option) any later version.
12 ** This program is distributed in the hope that it will be useful,
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ** GNU General Public License for more details.
17 ** You should have received a copy of the GNU General Public License
18 ** along with this program; see the file COPYING. If not, write to
19 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 ** Boston, MA 02110-1301, USA.
22 ****************************************************************************/
26 #include <QMessageBox>
27 #include <QInputDialog>
28 #define KMessageBox QMessageBox
29 #define error(parent, message, caption) \
30 critical(parent, caption, message)
32 #include <QApplication>
37 #include <QHBoxLayout>
38 #include <QVBoxLayout>
40 #include <QMouseEvent>
41 #include <QPushButton>
48 // Definition of key modifier mask constants
49 #define KMOD_Alt_R 0x01
50 #define KMOD_Alt_L 0x02
51 #define KMOD_Meta_L 0x04
52 #define KMOD_Control_L 0x08
53 #define KMOD_Shift_L 0x10
55 //local cursor width/height in px, should be an odd number
56 const int CURSOR_SIZE = 7;
58 const int TAP_PRESS_TIME = 180;
59 const int DOUBLE_TAP_UP_TIME = 500;
62 VncView::VncView(QWidget *parent, const KUrl &url, RemoteView::Quality quality, int listen_port)
70 m_firstPasswordTry(true),
71 m_dontSendClipboard(false),
72 m_horizontalFactor(1.0),
73 m_verticalFactor(1.0),
74 m_forceLocalCursor(false),
75 force_full_repaint(false),
77 listen_port(listen_port)
83 //BlockingQueuedConnection can cause deadlocks when exiting, handled in startQuitting()
84 connect(&vncThread, SIGNAL(imageUpdated(int, int, int, int)), this, SLOT(updateImage(int, int, int, int)), Qt::BlockingQueuedConnection);
85 connect(&vncThread, SIGNAL(gotCut(const QString&)), this, SLOT(setCut(const QString&)), Qt::BlockingQueuedConnection);
86 connect(&vncThread, SIGNAL(passwordRequest()), this, SLOT(requestPassword()), Qt::BlockingQueuedConnection);
87 connect(&vncThread, SIGNAL(outputErrorMessage(QString)), this, SLOT(outputErrorMessage(QString)));
89 m_clipboard = QApplication::clipboard();
90 connect(m_clipboard, SIGNAL(selectionChanged()), this, SLOT(clipboardSelectionChanged()));
91 connect(m_clipboard, SIGNAL(dataChanged()), this, SLOT(clipboardDataChanged()));
100 // Disconnect all signals so that we don't get any more callbacks from the client thread
101 vncThread.disconnect();
106 void VncView::forceFullRepaint()
108 force_full_repaint = true;
112 bool VncView::eventFilter(QObject *obj, QEvent *event)
115 if (event->type() == QEvent::KeyPress ||
116 event->type() == QEvent::KeyRelease ||
117 event->type() == QEvent::MouseButtonDblClick ||
118 event->type() == QEvent::MouseButtonPress ||
119 event->type() == QEvent::MouseButtonRelease ||
120 event->type() == QEvent::Wheel ||
121 event->type() == QEvent::MouseMove)
124 return RemoteView::eventFilter(obj, event);
127 QSize VncView::framebufferSize()
129 return m_frame.size();
132 QSize VncView::sizeHint() const
137 QSize VncView::minimumSizeHint() const
142 void VncView::startQuitting()
144 kDebug(5011) << "about to quit";
146 //const bool connected = status() == RemoteView::Connected;
148 setStatus(Disconnecting);
152 //if(connected) //remove if things work without it
155 const bool quitSuccess = vncThread.wait(700);
157 //happens when vncThread wants to call a slot via BlockingQueuedConnection,
158 //needs an event loop in this thread so execution continues after 'emit'
160 if(!loop.processEvents())
161 kDebug(5011) << "BUG: deadlocked, but no events to deliver?";
164 setStatus(Disconnected);
167 bool VncView::isQuitting()
172 bool VncView::start()
174 vncThread.setHost(m_host);
175 vncThread.setPort(m_port);
176 vncThread.setListenPort(listen_port); //if port is != 0, thread will listen for connections
177 vncThread.setQuality(quality);
179 // set local cursor on by default because low quality mostly means slow internet connection
180 if (quality == RemoteView::Low) {
181 showDotCursor(RemoteView::CursorOn);
184 setStatus(Connecting);
190 bool VncView::supportsScaling() const
195 bool VncView::supportsLocalCursor() const
200 void VncView::requestPassword()
202 kDebug(5011) << "request password";
204 setStatus(Authenticating);
206 if (!m_url.password().isNull()) {
207 vncThread.setPassword(m_url.password());
212 settings.beginGroup("hosts");
213 QString password = settings.value(QString("%1/password").arg(m_host), "").toString();
214 //check for saved password
215 if(m_firstPasswordTry and !password.isEmpty()) {
216 kDebug(5011) << "Trying saved password";
217 m_firstPasswordTry = false;
218 vncThread.setPassword(password);
221 m_firstPasswordTry = false;
224 QDialog dialog(this);
225 dialog.setWindowTitle(tr("Password required"));
227 QLineEdit passwordbox;
228 passwordbox.setEchoMode(QLineEdit::Password);
229 passwordbox.setText(password);
230 QCheckBox save_password(tr("Save Password"));
231 save_password.setChecked(!password.isEmpty()); //offer to overwrite saved password
232 QPushButton ok_button(tr("Done"));
233 ok_button.setMaximumWidth(100);
234 connect(&ok_button, SIGNAL(clicked()),
235 &dialog, SLOT(accept()));
239 layout2.addWidget(&passwordbox);
240 if(!m_host.isEmpty()) //don't save incomming connections
241 layout2.addWidget(&save_password);
242 layout1.addLayout(&layout2);
243 layout1.addWidget(&ok_button);
244 dialog.setLayout(&layout1);
246 if(dialog.exec()) { //dialog accepted
247 password = passwordbox.text();
249 if(!m_host.isEmpty() and save_password.isChecked()) {
250 kDebug(5011) << "Saving password for host '" << m_host << "'";
252 settings.setValue(QString("%1/password").arg(m_host), password);
256 vncThread.setPassword(password);
262 void VncView::outputErrorMessage(const QString &message)
264 if (message == "INTERNAL:APPLE_VNC_COMPATIBILTY") {
265 setCursor(localDotCursor());
266 m_forceLocalCursor = true;
272 emit errorMessage(i18n("VNC failure"), message);
275 void VncView::updateImage(int x, int y, int w, int h)
277 if(!QApplication::focusWidget()) { //no focus, we're probably minimized
281 //kDebug(5011) << "got update" << width() << height();
288 if (m_horizontalFactor != 1.0 || m_verticalFactor != 1.0) {
289 // If the view is scaled, grow the update rectangle to avoid artifacts
290 int x_extrapixels = 1.0/m_horizontalFactor + 1;
291 int y_extrapixels = 1.0/m_verticalFactor + 1;
295 m_w+=2*x_extrapixels;
296 m_h+=2*y_extrapixels;
299 m_frame = vncThread.image();
302 setAttribute(Qt::WA_StaticContents);
303 setAttribute(Qt::WA_OpaquePaintEvent);
304 installEventFilter(this);
306 setCursor(((m_dotCursorState == CursorOn) || m_forceLocalCursor) ? localDotCursor() : Qt::BlankCursor);
308 setMouseTracking(true); // get mouse events even when there is no mousebutton pressed
309 setFocusPolicy(Qt::WheelFocus);
310 setStatus(Connected);
311 // emit framebufferSizeChanged(m_frame.width(), m_frame.height());
314 resize(width(), height());
320 static QSize old_frame_size = QSize();
321 if ((y == 0 && x == 0) && (m_frame.size() != old_frame_size)) {
322 old_frame_size = m_frame.size();
323 kDebug(5011) << "Updating framebuffer size";
325 emit framebufferSizeChanged(m_frame.width(), m_frame.height());
329 repaint(qRound(m_x * m_horizontalFactor), qRound(m_y * m_verticalFactor), qRound(m_w * m_horizontalFactor), qRound(m_h * m_verticalFactor));
333 void VncView::setViewOnly(bool viewOnly)
335 RemoteView::setViewOnly(viewOnly);
337 m_dontSendClipboard = viewOnly;
340 setCursor(Qt::ArrowCursor);
342 setCursor(m_dotCursorState == CursorOn ? localDotCursor() : Qt::BlankCursor);
345 void VncView::showDotCursor(DotCursorState state)
347 RemoteView::showDotCursor(state);
349 setCursor(state == CursorOn ? localDotCursor() : Qt::BlankCursor);
352 //level should be in [0, 100]
353 void VncView::setZoomLevel(int level)
355 Q_ASSERT(parentWidget() != 0);
357 if(level == -1) { //handle resize
358 resize(m_frame.width()*m_horizontalFactor, m_frame.height()*m_verticalFactor);
362 double magnification;
365 } else if(level >= 90) {
368 const double min_horiz_magnification = double(parentWidget()->width())/m_frame.width();
369 const double min_vert_magnification = double(parentWidget()->height())/m_frame.height();
370 const double fit_screen_magnification = qMin(min_horiz_magnification, min_vert_magnification);
372 //level=90 => magnification=1.0, level=0 => magnification=fit_screen_magnification
373 magnification = (level)/90.0*(1.0 - fit_screen_magnification) + fit_screen_magnification;
376 if(magnification < 0 //remote display smaller than local?
377 or magnification != magnification) //nan
380 m_verticalFactor = m_horizontalFactor = magnification;
381 resize(m_frame.width()*magnification, m_frame.height()*magnification);
384 void VncView::setCut(const QString &text)
386 m_dontSendClipboard = true;
387 m_clipboard->setText(text, QClipboard::Clipboard);
388 m_clipboard->setText(text, QClipboard::Selection);
389 m_dontSendClipboard = false;
392 void VncView::paintEvent(QPaintEvent *event)
394 //kDebug(5011) << "paint event: x: " << m_x << ", y: " << m_y << ", w: " << m_w << ", h: " << m_h;
395 if (m_frame.isNull() || m_frame.format() == QImage::Format_Invalid) {
396 kDebug(5011) << "no valid image to paint";
397 RemoteView::paintEvent(event);
403 QPainter painter(this);
405 Qt::TransformationMode transformation_mode = Qt::SmoothTransformation;
406 if( m_horizontalFactor >= 1.0 )
407 transformation_mode = Qt::FastTransformation;
409 if (m_repaint and !force_full_repaint) {
410 // kDebug(5011) << "normal repaint";
411 painter.drawImage(QRect(qRound(m_x*m_horizontalFactor), qRound(m_y*m_verticalFactor),
412 qRound(m_w*m_horizontalFactor), qRound(m_h*m_verticalFactor)),
413 m_frame.copy(m_x, m_y, m_w, m_h).scaled(qRound(m_w*m_horizontalFactor),
414 qRound(m_h*m_verticalFactor),
415 Qt::IgnoreAspectRatio, transformation_mode));
417 //kDebug(5011) << "resize repaint";
418 QRect rect = event->rect();
419 if (!force_full_repaint and (rect.width() != width() || rect.height() != height())) {
420 // kDebug(5011) << "Partial repaint";
421 const int sx = rect.x()/m_horizontalFactor;
422 const int sy = rect.y()/m_verticalFactor;
423 const int sw = rect.width()/m_horizontalFactor;
424 const int sh = rect.height()/m_verticalFactor;
425 painter.drawImage(rect,
426 m_frame.copy(sx, sy, sw, sh).scaled(rect.width(), rect.height(),
427 Qt::IgnoreAspectRatio, transformation_mode));
429 kDebug(5011) << "Full repaint" << width() << height() << m_frame.width() << m_frame.height();
430 painter.drawImage(QRect(0, 0, width(), height()),
431 m_frame.scaled(m_frame.width() * m_horizontalFactor, m_frame.height() * m_verticalFactor,
432 Qt::IgnoreAspectRatio, transformation_mode));
433 force_full_repaint = false;
437 //draw local cursor ourselves, normal mouse pointer doesn't deal with scrolling
438 if((m_dotCursorState == CursorOn) || m_forceLocalCursor) {
439 #if QT_VERSION >= 0x040500
440 painter.setCompositionMode(QPainter::RasterOp_SourceXorDestination);
442 //rectangle size includes 1px pen width
443 painter.drawRect(cursor_x*m_horizontalFactor - CURSOR_SIZE/2, cursor_y*m_verticalFactor - CURSOR_SIZE/2, CURSOR_SIZE-1, CURSOR_SIZE-1);
446 RemoteView::paintEvent(event);
449 void VncView::resizeEvent(QResizeEvent *event)
451 RemoteView::resizeEvent(event);
455 bool VncView::event(QEvent *event)
457 switch (event->type()) {
458 case QEvent::KeyPress:
459 case QEvent::KeyRelease:
460 // kDebug(5011) << "keyEvent";
461 keyEventHandler(static_cast<QKeyEvent*>(event));
464 case QEvent::MouseButtonDblClick:
465 case QEvent::MouseButtonPress:
466 case QEvent::MouseButtonRelease:
467 case QEvent::MouseMove:
468 // kDebug(5011) << "mouseEvent";
469 mouseEventHandler(static_cast<QMouseEvent*>(event));
473 // kDebug(5011) << "wheelEvent";
474 wheelEventHandler(static_cast<QWheelEvent*>(event));
477 case QEvent::WindowActivate: //input panel may have been closed, prevent IM from interfering with hardware keyboard
478 setAttribute(Qt::WA_InputMethodEnabled, false);
481 return RemoteView::event(event);
485 //call with e == 0 to flush held events
486 void VncView::mouseEventHandler(QMouseEvent *e)
488 static bool tap_detected = false;
489 static bool double_tap_detected = false;
490 static bool tap_drag_detected = false;
491 static QTime press_time;
492 static QTime up_time; //used for double clicks/tap&drag, for time after first tap
494 if(!e) { //flush held taps
496 m_buttonMask |= 0x01;
497 vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask);
498 m_buttonMask &= 0xfe;
499 vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask);
500 tap_detected = false;
501 } else if(double_tap_detected and press_time.elapsed() > TAP_PRESS_TIME) { //got tap + another press -> tap & drag
502 m_buttonMask |= 0x01;
503 vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask);
504 double_tap_detected = false;
505 tap_drag_detected = true;
511 if(e->x() < 0 or e->y() < 0) { //QScrollArea tends to send invalid events sometimes...
516 cursor_x = qRound(e->x()/m_horizontalFactor);
517 cursor_y = qRound(e->y()/m_verticalFactor);
518 vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask); // plain move event
520 if(!disable_tapping and e->button() == Qt::LeftButton) { //implement touchpad-like input for left button
521 if(e->type() == QEvent::MouseButtonPress or e->type() == QEvent::MouseButtonDblClick) {
523 if(tap_detected and up_time.elapsed() < DOUBLE_TAP_UP_TIME) {
524 tap_detected = false;
525 double_tap_detected = true;
527 QTimer::singleShot(TAP_PRESS_TIME, this, SLOT(mouseEventHandler()));
529 } else if(e->type() == QEvent::MouseButtonRelease) {
530 if(tap_drag_detected) {
531 m_buttonMask &= 0xfe;
532 vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask);
533 tap_drag_detected = false;
534 } else if(double_tap_detected) { //double click
535 double_tap_detected = false;
537 m_buttonMask |= 0x01;
538 vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask);
539 m_buttonMask &= 0xfe;
540 vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask);
541 m_buttonMask |= 0x01;
542 vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask);
543 m_buttonMask &= 0xfe;
544 vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask);
545 } else if(press_time.elapsed() < TAP_PRESS_TIME) { //tap
548 QTimer::singleShot(DOUBLE_TAP_UP_TIME, this, SLOT(mouseEventHandler()));
552 } else { //middle or right button, send directly
553 if ((e->type() == QEvent::MouseButtonPress)) {
554 if (e->button() & Qt::MidButton)
555 m_buttonMask |= 0x02;
556 if (e->button() & Qt::RightButton)
557 m_buttonMask |= 0x04;
558 } else if (e->type() == QEvent::MouseButtonRelease) {
559 if (e->button() & Qt::MidButton)
560 m_buttonMask &= 0xfd;
561 if (e->button() & Qt::RightButton)
562 m_buttonMask &= 0xfb;
564 vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask);
567 //prevent local cursor artifacts
568 static int old_cursor_x = cursor_x;
569 static int old_cursor_y = cursor_y;
570 if(((m_dotCursorState == CursorOn) || m_forceLocalCursor)
571 and (cursor_x != old_cursor_x or cursor_y != old_cursor_y)) {
572 //clear last position
573 repaint(old_cursor_x*m_horizontalFactor - CURSOR_SIZE/2, old_cursor_y*m_verticalFactor - CURSOR_SIZE/2, CURSOR_SIZE, CURSOR_SIZE);
574 //and refresh new one
575 repaint(cursor_x*m_horizontalFactor - CURSOR_SIZE/2, cursor_y*m_verticalFactor - CURSOR_SIZE/2, CURSOR_SIZE, CURSOR_SIZE);
577 old_cursor_x = cursor_x; old_cursor_y = cursor_y;
581 void VncView::wheelEventHandler(QWheelEvent *event)
584 if (event->delta() < 0)
589 const int x = qRound(event->x() / m_horizontalFactor);
590 const int y = qRound(event->y() / m_verticalFactor);
592 vncThread.mouseEvent(x, y, eb | m_buttonMask);
593 vncThread.mouseEvent(x, y, m_buttonMask);
596 void VncView::keyEventHandler(QKeyEvent *e)
598 // strip away autorepeating KeyRelease; see bug #206598
599 if (e->isAutoRepeat() && (e->type() == QEvent::KeyRelease)) {
603 // parts of this code are based on http://italc.sourcearchive.com/documentation/1.0.9.1/vncview_8cpp-source.html
604 rfbKeySym k = e->nativeVirtualKey();
606 // we do not handle Key_Backtab separately as the Shift-modifier
607 // is already enabled
608 if (e->key() == Qt::Key_Backtab) {
612 const bool pressed = (e->type() == QEvent::KeyPress);
615 //don't send ISO_Level3_Shift (would break things like Win+0-9)
616 //also enable IM so symbol key works
618 setAttribute(Qt::WA_InputMethodEnabled, pressed);
625 if (k == XK_Shift_L || k == XK_Control_L || k == XK_Meta_L || k == XK_Alt_L) {
628 } else if (m_mods.contains(k)) {
636 int current_zoom = -1;
637 if(e->key() == Qt::Key_F8)
638 current_zoom = left_zoom;
639 else if(e->key() == Qt::Key_F7)
640 current_zoom = right_zoom;
642 // kDebug(5011) << "got '" << e->text() << "'.";
643 vncThread.keyEvent(k, pressed);
645 kDebug(5011) << "nativeVirtualKey() for '" << e->text() << "' failed.";
649 if(current_zoom == -1)
652 //handle zoom buttons
653 if(current_zoom == 0) { //left click
655 m_buttonMask |= 0x01;
657 m_buttonMask &= 0xfe;
658 vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask);
659 } else if(current_zoom == 1) { //right click
661 m_buttonMask |= 0x04;
663 m_buttonMask &= 0xfb;
664 vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask);
665 } else if(current_zoom == 2) { //middle click
667 m_buttonMask |= 0x02;
669 m_buttonMask &= 0xfd;
670 vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask);
671 } else if(current_zoom == 3 and pressed) { //wheel up
673 vncThread.mouseEvent(cursor_x, cursor_y, eb | m_buttonMask);
674 vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask);
675 } else if(current_zoom == 4 and pressed) { //wheel down
677 vncThread.mouseEvent(cursor_x, cursor_y, eb | m_buttonMask);
678 vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask);
679 } else if(current_zoom == 5) { //page up
680 vncThread.keyEvent(0xff55, pressed);
681 } else if(current_zoom == 6) { //page down
682 vncThread.keyEvent(0xff56, pressed);
686 void VncView::unpressModifiers()
688 const QList<unsigned int> keys = m_mods.keys();
689 QList<unsigned int>::const_iterator it = keys.constBegin();
690 while (it != keys.end()) {
691 vncThread.keyEvent(*it, false);
697 void VncView::clipboardSelectionChanged()
699 if (m_status != Connected)
702 if (m_clipboard->ownsSelection() || m_dontSendClipboard)
705 const QString text = m_clipboard->text(QClipboard::Selection);
707 vncThread.clientCut(text);
710 void VncView::clipboardDataChanged()
712 if (m_status != Connected)
715 if (m_clipboard->ownsClipboard() || m_dontSendClipboard)
718 const QString text = m_clipboard->text(QClipboard::Clipboard);
720 vncThread.clientCut(text);
724 void VncView::sendKey(Qt::Key key)
726 //convert Qt::Key into x11 keysym
738 case Qt::Key_PageDown:
756 case Qt::Key_Backspace:
771 k = 0xffbe + int(key - Qt::Key_F1);
783 case Qt::MetaModifier:
787 case Qt::AltModifier:
790 case Qt::Key_Control:
791 case Qt::ControlModifier:
795 kDebug(5011) << "sendKey(): Unhandled Qt::Key value " << key;
799 if (k == XK_Shift_L || k == XK_Control_L || k == XK_Meta_L || k == XK_Alt_L || k == XK_Super_L) {
800 if (m_mods.contains(k)) { //release
802 vncThread.keyEvent(k, false);
805 vncThread.keyEvent(k, true);
807 } else { //normal key
808 vncThread.keyEvent(k, true);
809 vncThread.keyEvent(k, false);
813 void VncView::sendKeySequence(QKeySequence keys)
815 Q_ASSERT(keys.count() <= 1); //we can only handle a single combination
817 //to get at individual key presses, we split 'keys' into its components
819 for(int i = 0; ; i++) {
820 QString k = keys.toString().section('+', i, i);
823 //kDebug(5011) << "found key: " << k;
825 key_list.append(Qt::Key_Alt);
826 } else if(k == "Ctrl") {
827 key_list.append(Qt::Key_Control);
828 } else if(k == "Meta") {
829 key_list.append(Qt::Key_Meta);
831 key_list.append(QKeySequence(k)[0]);
835 for(int i = 0; i < key_list.count(); i++)
836 sendKey(Qt::Key(key_list.at(i)));
838 //release modifiers (everything before final key)
839 for(int i = key_list.count()-2; i >= 0; i--)
840 sendKey(Qt::Key(key_list.at(i)));
843 void VncView::reloadSettings()
846 left_zoom = settings.value("left_zoom", 0).toInt();
847 right_zoom = settings.value("right_zoom", 1).toInt();
848 disable_tapping = settings.value("disable_tapping", false).toBool();
850 bool always_show_local_cursor = settings.value("always_show_local_cursor", false).toBool();
851 if(always_show_local_cursor)
852 showDotCursor(CursorOn);
857 //convert commitString into keyevents
858 void VncView::inputMethodEvent(QInputMethodEvent *event)
860 //TODO handle replacements
861 //NOTE for the return key to work Qt needs to enable multiline input, which only works for Q(Plain)TextEdit
863 //kDebug(5011) << event->commitString() << "|" << event->preeditString() << "|" << event->replacementLength() << "|" << event->replacementStart();
864 QString letters = event->commitString();
865 for(int i = 0; i < letters.length(); i++) {
866 char k = letters.at(i).toLatin1(); //works with all 'normal' keys, not umlauts.
868 kDebug(5011) << "unhandled key";
871 vncThread.keyEvent(k, true);
872 vncThread.keyEvent(k, false);
877 #include "moc_vncview.cpp"