Bug 45014 - [Qt] Number Pad Enter Key Returns Char Code 0 Instead of 13
Summary: [Qt] Number Pad Enter Key Returns Char Code 0 Instead of 13
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Normal
Assignee: QtWebKit Unassigned
URL:
Keywords: Qt
Depends on:
Blocks:
 
Reported: 2010-08-31 18:43 PDT by Jarred Nicholls
Modified: 2010-09-14 12:03 PDT (History)
6 users (show)

See Also:


Attachments
Patch that corrects the bug (574 bytes, patch)
2010-08-31 18:44 PDT, Jarred Nicholls
no flags Details | Formatted Diff | Diff
Patch + ChangeLog (1.36 KB, patch)
2010-09-01 12:40 PDT, Jarred Nicholls
no flags Details | Formatted Diff | Diff
Patch + ChangeLog (1.41 KB, patch)
2010-09-01 12:52 PDT, Jarred Nicholls
no flags Details | Formatted Diff | Diff
Manual Test (WebCore/manual-tests/qt/numpad-enter-key.html) (389 bytes, text/html)
2010-09-01 13:16 PDT, Jarred Nicholls
no flags Details
Cleaned up patch (2.59 KB, patch)
2010-09-14 11:51 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jarred Nicholls 2010-08-31 18:43:09 PDT
There is a missing case statement in the PlatformKeyboardEventQt.cpp file to handle the Enter button on the number pad.  Because it is not handled, the char code returned in a javascript event is 0 rather than 13.  Attached is an svn diff patch I'd like to submit.

Thanks,
Jarred
Comment 1 Jarred Nicholls 2010-08-31 18:44:35 PDT
Created attachment 66158 [details]
Patch that corrects the bug
Comment 2 Alexey Proskuryakov 2010-09-01 12:24:56 PDT
Does this affect any test results? If not, can you add a test covering this?
Comment 3 Jarred Nicholls 2010-09-01 12:28:24 PDT
(In reply to comment #2)
> Does this affect any test results? If not, can you add a test covering this?

No test are affected.  I will add a test to cover it.  I am also adding an appropriate ChangeLog as that was omitted previously.  Thanks!
Comment 4 Jarred Nicholls 2010-09-01 12:40:13 PDT
Created attachment 66245 [details]
Patch + ChangeLog
Comment 5 WebKit Review Bot 2010-09-01 12:41:21 PDT
Attachment 66245 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
WebCore/ChangeLog:5:  Line contains tab character.  [whitespace/tab] [5]
WebCore/ChangeLog:6:  Line contains tab character.  [whitespace/tab] [5]
WebCore/ChangeLog:8:  Line contains tab character.  [whitespace/tab] [5]
WebCore/ChangeLog:9:  Line contains tab character.  [whitespace/tab] [5]
WebCore/ChangeLog:10:  Line contains tab character.  [whitespace/tab] [5]
WebCore/ChangeLog:11:  Line contains tab character.  [whitespace/tab] [5]
Total errors found: 6 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Jarred Nicholls 2010-09-01 12:52:26 PDT
Created attachment 66247 [details]
Patch + ChangeLog
Comment 7 Jarred Nicholls 2010-09-01 13:16:21 PDT
Created attachment 66252 [details]
Manual Test (WebCore/manual-tests/qt/numpad-enter-key.html)

This is a manual test, not committed as a new file, but that could be placed in WebCore/manual-tests/qt/.  It tests the resulting keycode of keypress event
and pops an alert when 13 is discovered.  Prior to the patch, hitting Enter key on Number Pad did not result in an alert.  After the patch it does.

Thanks.
Comment 8 WebKit Review Bot 2010-09-01 13:18:00 PDT
Attachment 66252 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
Total errors found: 0 in 0 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Andreas Kling 2010-09-01 16:56:18 PDT
First off, I cannot reproduce the problem (WebKit trunk, Qt 4.7, Linux) using the manual test. Is this a platform specific problem?

Second, the manual test needs to include instructions on how to use it. Just a textual description in the page body is fine. (What should I press? Should NumLock be on/off? etc.) Also, please avoid the alert() if possible.

Third, please squash the patches into one (and make sure the test is included in the ChangeLog entry.)
Comment 10 Ariya Hidayat 2010-09-01 19:38:19 PDT
Comment on attachment 66252 [details]
Manual Test (WebCore/manual-tests/qt/numpad-enter-key.html)

Clear the review flag, this needs to be in the same patch as the fix.
Comment 11 Jarred Nicholls 2010-09-02 12:16:27 PDT
Thanks Andreas for the info.

I checked WebKit trunk, and there is no fix/case statement for the enter key under the "isKeypad" if branch.  See http://gitorious.org/webkit/webkit/blobs/master/WebCore/platform/qt/PlatformKeyboardEventQt.cpp  If there is no case statement for the return/enter keys, such as is included in my patch, then it is *not* fixed or working...that I can assure you.  I have suffered from this issue since 4.6.0, and finally got around to correcting it myself.

I didn't find a bug report for this on bugs.webkit.org, so I created it (my first one).  However just this morning I did find a bug report on Nokia's site from some time ago: http://bugreports.qt.nokia.com/browse/QTWEBKIT-221  The submitted patch is nearly identical to my patch, only it is missing the Qt::Key_Return case statement.

I too am running WebKit trunk, Qt 4.7, and Linux.  Num Lock is on, and before I compiled my change in, the normalized keycode that is returned is 0.  Afterwards, it is properly 13.

Thanks,
Jarred
Comment 12 Antonio Gomes 2010-09-02 13:25:22 PDT
LGTM too.

Jarred, as said, please make your manual test and the patch in the same patch file, and re-upload.
Comment 13 Andreas Kling 2010-09-14 11:51:38 PDT
Created attachment 67581 [details]
Cleaned up patch

Same patch including cleaned-up manual test.
Comment 14 Andreas Kling 2010-09-14 12:03:04 PDT
Comment on attachment 67581 [details]
Cleaned up patch

Clearing flags on attachment: 67581

Committed r67483: <http://trac.webkit.org/changeset/67483>
Comment 15 Andreas Kling 2010-09-14 12:03:15 PDT
All reviewed patches have been landed.  Closing bug.