ISSUE-161 (KeyboardEvent.key): Clarify KeyboardEvent.key [DOM3 Events]

ISSUE-161 (KeyboardEvent.key): Clarify KeyboardEvent.key [DOM3 Events]

http://www.w3.org/2008/webapps/track/issues/161

Raised by: Doug Schepers
On product: DOM3 Events

David Flanagan <http://lists.w3.org/Archives/Public/www-dom/2010OctDec/0065.html>:
[[
6) In the description of KeyboardEvent.key, it says "If the value is a 
character, it must match the value of the KeyboardEvent.char attribute." 
  First, is "character" formally defined somewhere, or you mean 
something like "If the key has a printable representation".  Second: 
what about the case of keyboard macros?  If I've somehow bound Ctrl-J to 
insert the string "JavaScript", then I would expect a Ctrl-J 
KeyboardEvent to have "JavaScript" as its char value and "J" as its key 
value.  If this is the correct behavior then the phrase "must match" in 
the spec is a problem.  If keyboard macros are supposed to get expanded 
into the key property, then that allows us to fake out keys that we 
don't have on our keyboards by defining keyboard macros.  In that case, 
if I define a macro to insert the string "Camera", then that macro might 
cause a webapp to behave as if the Camera key had been pressed.  (It 
almost seems like there is a security issue there...)

]]

Received on Wednesday, 20 October 2010 16:45:59 UTC