Bug 192122 - onkeydown, onkeypress keyCode returns incorrect value
Summary: onkeydown, onkeypress keyCode returns incorrect value
Status: RESOLVED NOT A BUG
Alias: None
Product: konqueror
Classification: Applications
Component: khtml event (show other bugs)
Version: 4.2.3
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-09 13:07 UTC by lunter
Modified: 2012-01-13 07:10 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
source (277 bytes, text/html)
2009-05-09 13:07 UTC, lunter
Details

Note You need to log in before you can comment on or make changes to this bug.
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