[PATCH] konqueror keyboard link navigation
Robert Ewald
robewald at gmx.net
Wed Dec 1 14:18:17 GMT 2004
Hi,
I made a patch implementing my idea of efficient link navigation in an html
view.
It works as follows:
In an HTML view you hit 'd' and a tooltips over each visible link is
displayed. The tooltip contains a keysequence to access that link. Entering
the keysequence focusses the link and upon hitting enter the link is followed
(although that does not work reliably yet).
Implementation details:
Upon hitting 'D' displayLinkNavTooltips() is called. Each Element in the
HTMLTree is traversed and tested for HREF. If this Element is also visible,
it is added to the list linkNavElements.
To fill the tooltips the 26 characters in the alphabet are seen as a number,
with a=0 and z=26. Converting the position of the element in the list to
base26 yields a keysequence, which is displayed in the tooltip.
linkNavActivated is set to true and on further keypresses,
dispatchKeyEventHelper fills a search string, which is converted to a decimal
position in the element list. This Element is then focussed.
Thats what I think I have implemented. At the moment the element is only
focussed. I would rather have, that the keypresses are enough so no enter is
needed. Therefore I have to determine the number of characters needed in the
tooltips. For this task i would need to include "math.h" (or anything
implementing a log or ln function). I am reluctant to add a dependency,
thats why I would like some advice.
Thanks
Robert Ewald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_khtmlview.cpp
Type: text/x-diff
Size: 6383 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20041201/95e5ac37/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_khtmlview.h
Type: text/x-diff
Size: 723 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20041201/95e5ac37/attachment-0001.diff>
More information about the kfm-devel
mailing list