diff options
author | David E. Narváez <david.narvaez@computer.org> | 2012-01-21 10:56:32 -0500 |
---|---|---|
committer | David E. Narváez <david.narvaez@computer.org> | 2012-01-21 10:56:32 -0500 |
commit | 88dae40c0f62a73dc3ead2cb4ff08a330af2acfa (patch) | |
tree | a86cc6ededaad2b732d1a31fe6d51e2f01881eff | |
parent | Renamed variable to avoid confusion - it is not a member variable (diff) | |
parent | Fix use of shift keys on input elements (diff) | |
download | rekonq-88dae40c0f62a73dc3ead2cb4ff08a330af2acfa.tar.xz |
Merge branch 'master' of git.kde.org:rekonq
-rw-r--r-- | src/webview.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/webview.cpp b/src/webview.cpp index f4884743..fffa5679 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -639,8 +639,10 @@ void WebView::keyPressEvent(QKeyEvent *event) return; } + const QString tagName = page()->mainFrame()->evaluateJavaScript("document.activeElement.tagName").toString(); + // Auto Scrolling - if (event->modifiers() == Qt::ShiftModifier) + if (tagName != QL1S("INPUT") && tagName != QL1S("TEXTAREA") && event->modifiers() == Qt::ShiftModifier) { kDebug() << "AutoScrolling: " << event->key(); @@ -649,6 +651,8 @@ void WebView::keyPressEvent(QKeyEvent *event) m_vScrollSpeed--; if (!m_autoScrollTimer->isActive()) m_autoScrollTimer->start(); + + event->accept(); return; } @@ -657,6 +661,8 @@ void WebView::keyPressEvent(QKeyEvent *event) m_vScrollSpeed++; if (!m_autoScrollTimer->isActive()) m_autoScrollTimer->start(); + + event->accept(); return; } @@ -665,6 +671,8 @@ void WebView::keyPressEvent(QKeyEvent *event) m_hScrollSpeed++; if (!m_autoScrollTimer->isActive()) m_autoScrollTimer->start(); + + event->accept(); return; } @@ -673,6 +681,8 @@ void WebView::keyPressEvent(QKeyEvent *event) m_hScrollSpeed--; if (!m_autoScrollTimer->isActive()) m_autoScrollTimer->start(); + + event->accept(); return; } @@ -685,12 +695,14 @@ void WebView::keyPressEvent(QKeyEvent *event) if (m_vScrollSpeed || m_hScrollSpeed) m_autoScrollTimer->start(); } + + event->accept(); + return; } // vi-like navigation if (ReKonfig::enableViShortcuts()) { - const QString tagName = page()->mainFrame()->evaluateJavaScript("document.activeElement.tagName").toString(); if (tagName != QL1S("INPUT") && tagName != QL1S("TEXTAREA") && event->modifiers() == Qt::NoModifier) { kDebug() << "Using VI-LIKE modifiers: " << event->key(); |