summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-01-20 15:52:07 +0100
committerAndrea Diamantini <adjam7@gmail.com>2012-01-20 15:52:07 +0100
commit8b663e01e03f07f9e3996e82a014222bd62bb4b4 (patch)
treeaa7c17f891b5d0e705922418604a96c070a789e7
parentRefactoring Code to Load Configuration Document (diff)
downloadrekonq-8b663e01e03f07f9e3996e82a014222bd62bb4b4.tar.xz
Fix use of shift keys on input elements
-rw-r--r--src/webview.cpp16
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();