summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-06-27 23:58:37 +0200
committerAndrea Diamantini <adjam7@gmail.com>2011-06-27 23:58:37 +0200
commitbe0d469407cb2126fb73bd6ee7c476743b9a046f (patch)
treec2e89561b1df795326915d2ec5215a1886a7c604
parentMake it compiles with "-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS" (diff)
downloadrekonq-be0d469407cb2126fb73bd6ee7c476743b9a046f.tar.xz
Add shortcuts for scrolling as in vi or konqi
BUG:238761 Patch by Thomas Murach, thanks :D Reviewed by me ;)
-rw-r--r--src/webview.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index ca7f1b70..30acaefe 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -621,6 +621,27 @@ void WebView::keyPressEvent(QKeyEvent *event)
}
}
+ if (event->key() == Qt::Key_J && event->modifiers() == Qt::NoModifier)
+ {
+ QKeyEvent event1(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier);
+ event = &event1;
+ }
+ if (event->key() == Qt::Key_K && event->modifiers() == Qt::NoModifier)
+ {
+ QKeyEvent event1(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier);
+ event = &event1;
+ }
+ if (event->key() == Qt::Key_L && event->modifiers() == Qt::NoModifier)
+ {
+ QKeyEvent event1(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier);
+ event = &event1;
+ }
+ if (event->key() == Qt::Key_H && event->modifiers() == Qt::NoModifier)
+ {
+ QKeyEvent event1(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier);
+ event = &event1;
+ }
+
KWebView::keyPressEvent(event);
}