From 38456333a3d3a0de4335ceba350ed8a0b6c11a48 Mon Sep 17 00:00:00 2001 From: "S. Razi Alavizadeh" Date: Wed, 22 Aug 2012 21:21:25 +0430 Subject: [PATCH] Improved, `AKN_Handler` handles pressed key case-insensitive if it's possible. --- src/plugins/AccessKeysNavigation/akn_handler.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/plugins/AccessKeysNavigation/akn_handler.cpp b/src/plugins/AccessKeysNavigation/akn_handler.cpp index 38f412df7..92d59da1d 100644 --- a/src/plugins/AccessKeysNavigation/akn_handler.cpp +++ b/src/plugins/AccessKeysNavigation/akn_handler.cpp @@ -175,6 +175,20 @@ void AKN_Handler::handleAccessKey(QKeyEvent* event) QChar key = text.at(0); + QChar other(QChar::Null); + if (key.isLower()) { + other = key.toUpper(); + } + else if (key.isUpper()) { + other = key.toLower(); + } + + if (!other.isNull() + && m_accessKeyNodes.contains(other) + && !m_accessKeyNodes.contains(key)) { + key = other; + } + if (m_accessKeyNodes.contains(key)) { QWebElement element = m_accessKeyNodes[key]; QPoint p = element.geometry().center();