[PATCH] accesskey attribute (#45788)

Lubos Lunak l.lunak at suse.cz
Thu Jan 22 12:44:47 GMT 2004


 Hello,

 please review the attached khtml.patch for adding support for the accesskey 
attribute. I based the searching and focusing code on the one used for 
tabbing to next element, so I hope I got it right. It uses Ctrl+Alt as the 
combination for the shortcut, because that's what Mozilla uses, and I didn't 
see a better option (IE's Alt alone is probably way too intrusive, Meta is 
not available everywhere, other modifiers combinations are already used in 
Konqueror). We have a couple of Ctrl+Alt global shortcuts (Klipper, lock 
screen,etc.), but people can change those.

 There should be only two problems remaining, first one (probably not that 
important for now) is the fact that the mapping from QKeyEvent to accesskey 
is not complete. When Qt creates the contents for QKeyEvent::text() it takes 
the modifiers pressed in account, resulting in some strange results, but for 
the accesskey the modifiers should be ignored. I added code handling A-Z and 
0-9, the rest uses simply text()[ 0 ] for now (and in fact it even work e.g. 
for eacute for me). In case somebody needs some really obscure accesskey, I 
can try to handle it :).

 The second, more important problem I have is how to actually trigger the 
action in the HTML element. 
http://lists.w3.org/Archives/Public/www-dom/2002AprJun/0137.html makes me 
believe just dispatching DOMActivate event like the patch currently does 
should do, but it doesn't really work for most elements. As I lack any 
serious knowledge of KHTML/DOM, I have no idea if this is KHTML bug or if it 
should be done differently. Should all input elements have something like the 
html_inlineimpl.cpp.patch does for <A> ?

 PS: Who can I annoy about adding accesskey's for next/previous at 
bugs.kde.org ;) ?

-- 
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: khtml.patch
Type: text/x-diff
Size: 6800 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20040122/6dc35ec7/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: html_inlineimpl.cpp.patch
Type: text/x-diff
Size: 857 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20040122/6dc35ec7/attachment-0001.patch>


More information about the kfm-devel mailing list