From b65b14653f1737633bba662828874a5478316e40 Mon Sep 17 00:00:00 2001 From: christian Date: Wed, 15 Sep 2010 23:31:22 +0200 Subject: [PATCH] don't start virtual keyboard with caps lock enabled --- debian/changelog | 1 + src/connectdialog.cpp | 1 - src/mainwindow.cpp | 2 ++ src/vncview.cpp | 20 ++++++++++---------- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index 92af072..1ea6e0c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ presencevnc (0.5) unstable; urgency=low * Add "..." menu for additional keys * Symbol key (Fn+Ctrl) fixed + * Don't start virtual keyboard with caps lock enabled -- Christian Pulvermacher Fri, 27 Aug 2010 19:09:29 +0200 diff --git a/src/connectdialog.cpp b/src/connectdialog.cpp index 7694835..21df3a5 100644 --- a/src/connectdialog.cpp +++ b/src/connectdialog.cpp @@ -53,7 +53,6 @@ ConnectDialog::ConnectDialog(QWidget *parent): //set up combobox hosts.addItems(hostnames_sorted); hosts.setEditable(true); - //hosts.lineEdit()->setInputMethodHints(Qt::ImhLowercaseOnly); //doesn't work, but I tried. connect(&hosts, SIGNAL(editTextChanged(QString)), this, SLOT(cleanHostname(QString))); layout.addWidget(&hosts); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 385e1a2..b69182f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -336,7 +336,9 @@ void MainWindow::resizeEvent(QResizeEvent *event) void MainWindow::showInputPanel() { #ifdef Q_WS_MAEMO_5 + //TODO: when hardware keyboard is open, this will only cause the IM to mess up 'real' key events vnc_view->setAttribute(Qt::WA_InputMethodEnabled, true); + vnc_view->setInputMethodHints(Qt::ImhPreferLowercase); //without this, IM starts with caps lock QEvent event(QEvent::RequestSoftwareInputPanel); QApplication::sendEvent(vnc_view, &event); diff --git a/src/vncview.cpp b/src/vncview.cpp index 9788390..79e3b7e 100644 --- a/src/vncview.cpp +++ b/src/vncview.cpp @@ -585,16 +585,16 @@ void VncView::mouseEventHandler(QMouseEvent *e) } } else { //middle or right button, send directly - if ((e->type() == QEvent::MouseButtonPress)) { - if (e->button() & Qt::MidButton) - m_buttonMask |= 0x02; - if (e->button() & Qt::RightButton) - m_buttonMask |= 0x04; - } else if (e->type() == QEvent::MouseButtonRelease) { - if (e->button() & Qt::MidButton) - m_buttonMask &= 0xfd; - if (e->button() & Qt::RightButton) - m_buttonMask &= 0xfb; + if ((e->type() == QEvent::MouseButtonPress)) { + if (e->button() & Qt::MidButton) + m_buttonMask |= 0x02; + if (e->button() & Qt::RightButton) + m_buttonMask |= 0x04; + } else if (e->type() == QEvent::MouseButtonRelease) { + if (e->button() & Qt::MidButton) + m_buttonMask &= 0xfd; + if (e->button() & Qt::RightButton) + m_buttonMask &= 0xfb; } vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask); } -- 1.7.9.5