Closed GoogleCodeExporter closed 9 years ago
Raising priority to reflect the fact that keyboard based applications are
essentially broken when using SVG Web inline images and there is no workaround
yet.
My current plan is to try supporting key events on the svg root element. The
idea is that you would register that listener as well as one on document. This
would require extra code to register that key listener for SVG Web, so that is
not optimal. Another solution is to try to bubble key events to the document or
window listeners, but that is harder because we have to intercept
addEventListener. However, that would not require any special code to work with
SVG Web.
Original comment by grick23@gmail.com
on 26 Jun 2010 at 3:33
As of r1226 document.addEventListener('keydown', listener, useCapture) should
work.
The form onkeydown=function(evt) {} is not supported.
Adding keyboard listeners to the window is not supported.
Note that firefox and chrome behave strangely with respect to keyboard events.
If the flash control has attribute wmode='transparent' then keyboard events
captured while flash has the focus are also dispatched to any top level
document listeners. When wmode is not set, then the keyboard events flash
captures are not also dispatched to the document listeners. Note that wmode is
always set to transparent unless the svg image has 'background-color' set.
So, if the flash control is rendering and inline svg image and has the focus,
we relay the keyboard event to any registered keyboard listeners on the
document UNLESS it is firefox or chrome and wmode is 'transparent', in which
case the document will get the event anyway so we do not bother.
There still remains some conditions where the keyboard events do not work
exactly the same as the browser. If you add keyboard listeners to an object
embedded svg image and you do not set background-color, then any keyboard
events captured by flash will be relayed to document listeners, and those
listeners will ALSO get the native keyboard event directly. If this corner case
is a problem for you, either set background-color on the svg root, or look at
evt.target and filter out the extra event coming from the embed.
Issue 433 remains open for support of document.onkeydown = function(evt) {}
Original comment by grick23@gmail.com
on 8 Aug 2010 at 4:43
Test files for keyboard issues
Original comment by grick23@gmail.com
on 8 Aug 2010 at 4:40
Attachments:
The condition I mentioned in the last part of comment #2 has been fixed now in
r1245. The extra event is no longer bubbled.
Original comment by grick23@gmail.com
on 20 Nov 2010 at 11:56
Fixed problem with IE7 in r1246.
Original comment by grick23@gmail.com
on 21 Nov 2010 at 7:58
Supported keyup event in r1247.
Original comment by grick23@gmail.com
on 21 Nov 2010 at 8:17
Original issue reported on code.google.com by
grick23@gmail.com
on 13 Jun 2010 at 8:50