toolbar->addAction("Esc", this, SLOT(sendEsc()));
toolbar->addAction("PgUp", this, SLOT(sendPgUp()));
toolbar->addAction("PgDn", this, SLOT(sendPgDn()));
- toolbar->addAction("IM", this, SLOT(showInputPanel()));
+ toolbar->addAction(QIcon("/usr/share/icons/hicolor/48x48/hildon/chat_enter.png"), "", this, SLOT(sendReturn()));
+ toolbar->addAction(QIcon("/usr/share/icons/hicolor/48x48/hildon/control_keyboard.png"), "", this, SLOT(showInputPanel()));
toolbar->addAction(QIcon("/usr/share/icons/hicolor/48x48/hildon/general_fullsize.png"), "", this, SLOT(toggleFullscreen()));
addToolBar(toolbar);
toolbar->setVisible(settings.value("show_toolbar", true).toBool());
connect(m_clipboard, SIGNAL(dataChanged()), this, SLOT(clipboardDataChanged()));
reloadSettings();
+
}
VncView::~VncView()
void VncView::keyEventHandler(QKeyEvent *e)
{
// strip away autorepeating KeyRelease; see bug #206598
- if (e->isAutoRepeat() && (e->type() == QEvent::KeyRelease))
+ if (e->isAutoRepeat() && (e->type() == QEvent::KeyRelease)) {
return;
+ }
// parts of this code are based on http://italc.sourcearchive.com/documentation/1.0.9.1/vncview_8cpp-source.html
rfbKeySym k = e->nativeVirtualKey();
current_zoom = left_zoom;
else if(e->key() == Qt::Key_F7)
current_zoom = right_zoom;
- else if (k)
+ else if (k) {
+ // kDebug(5011) << "got '" << e->text() << "'.";
vncThread.keyEvent(k, pressed);
- else {
+ } else {
kDebug(5011) << "nativeVirtualKey() for '" << e->text() << "' failed.";
return;
}
case Qt::Key_PageDown:
k = 0xff56;
break;
+ case Qt::Key_Return:
+ k = 0xff0d;
+ break;
case Qt::Key_Meta: //TODO: test this.
k = XK_Super_L;
break;
k = XK_Alt_L;
break;
default:
- kDebug(5011) << "unhandled Qt::Key value " << key;
+ kDebug(5011) << "sendKey(): Unhandled Qt::Key value " << key;
return;
}
{
//TODO handle replacements
//TODO convert utf8 to X11 keysyms myself, should work with umlauts, kana...
- //TODO Enter?
+ //NOTE for the return key to work Qt needs to enable multiline input, which only works for Q(Plain)TextEdit
+
+ //kDebug(5011) << event->commitString() << "|" << event->preeditString() << "|" << event->replacementLength() << "|" << event->replacementStart();
QString letters = event->commitString();
for(int i = 0; i < letters.length(); i++) {
char k = letters.at(i).toLatin1(); //works with all 'normal' keys, not umlauts.
kDebug(5011) << "unhandled key";
continue;
}
+ kDebug(5011) << "key: " << int(k);
vncThread.keyEvent(k, true);
vncThread.keyEvent(k, false);
}
}
+
#include "moc_vncview.cpp"