summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-01-31 19:15:27 +0100
committerAndrea Diamantini <adjam7@gmail.com>2012-01-31 19:15:27 +0100
commit78ad9ec7f2501bbfe6cf5113351a408929cb78ff (patch)
treef1fa75aa2ff4e03da935d4d5dd0b4df1da259644
parent(Hopefully) finally fixing access keys (diff)
downloadrekonq-78ad9ec7f2501bbfe6cf5113351a408929cb78ff.tar.xz
Just check access keys on CTRL release
-rw-r--r--src/webview.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index 1c2a4028..115df2a1 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -778,25 +778,29 @@ void WebView::keyPressEvent(QKeyEvent *event)
void WebView::keyReleaseEvent(QKeyEvent *event)
{
// access keys management
- if (ReKonfig::accessKeysEnabled())
+ if (ReKonfig::accessKeysEnabled() && m_accessKeysPressed)
{
- if (m_accessKeysPressed && event->key() != Qt::Key_Control)
- m_accessKeysPressed = false;
-
- if (m_accessKeysPressed && !(event->modifiers() & Qt::ControlModifier))
+ if (event->key() != Qt::Key_Control)
{
- kDebug() << "Shotting access keys";
- QTimer::singleShot(200, this, SLOT(accessKeyShortcut()));
- event->accept();
- return;
+ m_accessKeysPressed = false;
}
else
{
- checkForAccessKey(event);
- kDebug() << "Hiding access keys";
- hideAccessKeys();
- event->accept();
- return;
+ if ((event->modifiers() & Qt::ControlModifier))
+ {
+ checkForAccessKey(event);
+ kDebug() << "Hiding access keys";
+ hideAccessKeys();
+ event->accept();
+ return;
+ }
+ else
+ {
+ kDebug() << "Shotting access keys";
+ QTimer::singleShot(200, this, SLOT(accessKeyShortcut()));
+ event->accept();
+ return;
+ }
}
}