KApplication::keyboardModifiers() problems
Lubos Lunak
l.lunak at suse.cz
Wed Jul 28 09:47:12 BST 2004
Hello,
while testing a recent KHTML accesskeys change I noticed that
KApplication::keyboardModifiers() has a couple of problems waiting to
surprise the unwary developer:
- The keyboard modifiers state includes also state of things like NumLock.
E.g. the accesskey code uses KApplication::keyboardModifers() == 0 and
accesskeys stop working as soon as you turn NumLock on. It might seem to be
very surprising and stupid to people who don't know this, probably because it
is so.
- The HTML API documentation
(http://developer.kde.org/documentation/library/cvs-api/kdecore/html/classKApplication.html#e17)
doesn't say what it really returns and it even may seem to suggest it returns
the same like QKeyEvent::state() which is not true.
- It adds yet another way of representing the modifiers to the already two
existing incompatible Qt and KAccel ways (ok, it's not really a new way, but
how many KDE devels use X11 directly?).
Any comments on the attached patch?
--
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o. e-mail: l.lunak at suse.cz , l.lunak at kde.org
Drahobejlova 27 tel: +420 2 9654 2373
190 00 Praha 9 fax: +420 2 9654 2374
Czech Republic http://www.suse.cz/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kapplication.h.patch
Type: text/x-diff
Size: 2215 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040728/f4f6a5bc/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kapplication.cpp.patch
Type: text/x-diff
Size: 1347 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040728/f4f6a5bc/attachment-0001.patch>
More information about the kde-core-devel
mailing list