don't start virtual keyboard with caps lock enabled
authorchristian <christian@christian-laptop.(none)>
Wed, 15 Sep 2010 21:31:22 +0000 (23:31 +0200)
committerchristian <christian@christian-laptop.(none)>
Wed, 15 Sep 2010 21:31:22 +0000 (23:31 +0200)
debian/changelog
src/connectdialog.cpp
src/mainwindow.cpp
src/vncview.cpp

index 92af072..1ea6e0c 100644 (file)
@@ -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 <pulvermacher@gmx.de>  Fri, 27 Aug 2010 19:09:29 +0200
 
index 7694835..21df3a5 100644 (file)
@@ -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);
index 385e1a2..b69182f 100644 (file)
@@ -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);
index 9788390..79e3b7e 100644 (file)
@@ -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);
        }