diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2011-06-27 23:58:37 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-06-27 23:58:37 +0200 |
commit | be0d469407cb2126fb73bd6ee7c476743b9a046f (patch) | |
tree | c2e89561b1df795326915d2ec5215a1886a7c604 | |
parent | Make it compiles with "-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS" (diff) | |
download | rekonq-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.cpp | 21 |
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); } |