Bug 192122

Summary: onkeydown, onkeypress keyCode returns incorrect value
Product: [Applications] konqueror Reporter: lunter <lunter>
Component: khtml eventAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED NOT A BUG    
Severity: normal CC: browserbugs2, luke-jr+kdebugs
Priority: NOR    
Version: 4.2.3   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Attachments: source

Description lunter 2009-05-09 13:07:03 UTC
Version:           4.2.3 (using KDE 4.2.2)
OS:                MS Windows
Installed from:    MS Windows

<body>
 <div>Please press [RightControl]+[Pause/Break] on keyboard</div>
 <div>Should alert: 3</div>
 <div>keyCode: <span id="test"></span></div>
 <script>
  document.onkeydown=function(e){document.getElementById('test').innerHTML=(e?e:event).keyCode}
 </script>
</body>

Konqueror: 1
---
Opera: 3
IE: 3
Chrome: 3
Safari: 3
Firefox: 3
Comment 1 lunter 2009-05-09 13:07:38 UTC
Created attachment 33487 [details]
source
Comment 2 Luke-Jr 2009-07-29 01:21:10 UTC
I get "0" on Linux... This is also broken for "`" and probably a number of other keys/combinations. Perhaps KHTML needs to use the mappings from QtWebKit?
Comment 3 Gérard Talbot (no longer involved) 2011-08-16 09:22:28 UTC
lunter, your testcase has no doctype declaration triggering Konqueror into standards compliant rendering mode. Nevertheless,

I get "0" with Firefox 5.0, 
I get "17" with Opera 11.50, 
I get "0" with Chrome 13.0.782.112 and
I get "0" with Konqueror 4.7.0.


When trying, testing and verifying [RightControl]+[Pause/Break] in
Keyboard events and codes: Key and Character Codes vs. Event Types
http://www.w3.org/2002/09/tests/keys-cancel2.html
then I get again the results above.

I am using
KDE Platform Version: 4.7.0
Konqueror version: 4.7.0 (KHTML rendering engine)
Qt Version: 4.7.2
Operating System: Linux 2.6.38-11-generic-pae i686 (32bits)
Distribution: Kubuntu 11.04
here.

regards, Gérard
Comment 4 Gérard Talbot (no longer involved) 2012-01-13 07:10:26 UTC
lunter,

The Konqueror behavior in your testcase is, as far as I can say, correct and compliant. 

I changed component from kjs to KHTML event, since this is clearly DOM 2 events stuff.

Resolving as INVALID