[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdelibs/khtml
From: Jean-Baptiste Mardelle <bj () altern ! org>
Date: 2004-07-27 22:20:49
Message-ID: 20040727222049.3BEF09A02 () office ! kde ! org
[Download RAW message or body]
CVS commit by mardelle:
Fix accesskey system for sticky keys:
Access keys are activated when the ctrl key is released.
*Default config: press once on ctrl
*Sticky keys: press twice on ctrl
*Sticky keys+lock: press three times ctrl
M +3 -5 khtmlview.cpp 1.651
--- kdelibs/khtml/khtmlview.cpp #1.650:1.651
@@ -1121,5 +1121,5 @@ void KHTMLView::keyPressEvent( QKeyEvent
// If CTRL was hit, be prepared for access keys
- if (_ke->key() == Key_Control)
+ if (_ke->key() == Key_Control && _ke->state()==0)
d->accessKeysPreActivate=true;
@@ -1411,7 +1411,6 @@ void KHTMLView::keyReleaseEvent(QKeyEven
return;
}
-
if (d->accessKeysPreActivate && _ke->key() != Key_Control) \
d->accessKeysPreActivate=false;
- if (_ke->key() == Key_Control && d->accessKeysPreActivate && _ke->state() == \
Qt::ControlButton) + if (_ke->key() == Key_Control && d->accessKeysPreActivate && \
_ke->state() == Qt::ControlButton && KApplication::keyboardModifiers()==0) {
QString accessMsg=i18n("Access Keys activated");
@@ -1526,5 +1525,4 @@ bool KHTMLView::eventFilter(QObject *o,
{
if ( e->type() == QEvent::AccelOverride ) {
- d->accessKeysPreActivate=false;
QKeyEvent* ke = (QKeyEvent*) e;
//kdDebug(6200) << "QEvent::AccelOverride" << endl;
@@ -1903,5 +1901,5 @@ m_part->setStatusBarText(QString::null,
bool KHTMLView::handleAccessKey( const QKeyEvent* ev )
{
-if (!d->accessKeysActivated) return false;
+if (!d->accessKeysActivated || ev->state()!=0) return false;
// Qt interprets the keyevent also with the modifiers, and ev->text() matches that,
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic