Bug 22679

Summary: [GTK] Function Keys (F1 to F12) are not mapped
Product: WebKit Reporter: Srinivas Rao M Hamse <msrinirao>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Major    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Patch for F1-F12 key mappings for WebKit GTK port
eric: review+
Patch for F1-F12 key mappings for WebKit GTK port
none
Patch for F1-F12 key mappings for WebKit GTK port(Eric Suggestion)
zecke: review+
Patch for F1-F12 key mappings for WebKit GTK port(Eric Suggestion, Using GCC extension) none

Srinivas Rao M Hamse
Reported 2008-12-05 02:47:57 PST
I am using WebKit(r38592)+Gtk on DirectFB 1.2.0. Wrote a simple javascript to capture onkeydown, onkeyup events. Key events are coming for all other keys except Function keys, i.e F1 through F12 available in standard keyboards. I think these keys are not working for GTK Port. I made a fix for this, and will post it soon.
Attachments
Patch for F1-F12 key mappings for WebKit GTK port (2.28 KB, patch)
2008-12-05 02:56 PST, Srinivas Rao M Hamse
eric: review+
Patch for F1-F12 key mappings for WebKit GTK port (2.37 KB, patch)
2008-12-08 21:31 PST, Srinivas Rao M Hamse
no flags
Patch for F1-F12 key mappings for WebKit GTK port(Eric Suggestion) (deleted)
2008-12-08 22:36 PST, Srinivas Rao M Hamse
zecke: review+
Patch for F1-F12 key mappings for WebKit GTK port(Eric Suggestion, Using GCC extension) (1.28 KB, patch)
2008-12-08 22:38 PST, Srinivas Rao M Hamse
no flags
Srinivas Rao M Hamse
Comment 1 2008-12-05 02:56:36 PST
Created attachment 25769 [details] Patch for F1-F12 key mappings for WebKit GTK port The code segment i used for testing is: <body onkeydown="callme(event)"> </body> <script> function callme(e) { if (e.which == null) char = String.fromCharCode(e.keyCode); // IE else if (e.which > 0) char = String.fromCharCode(e.which); // All others else char = x // special key alert(e.keyCode + " : " + e.charCode + " --> " + e.which); // alert(" --> " + char); } </script>
Holger Freyther
Comment 2 2008-12-05 03:55:41 PST
Comment on attachment 25769 [details] Patch for F1-F12 key mappings for WebKit GTK port > +2008-12-07 Srinivasa Rao. M Hamse <msrinirao@gmail.com> > + > + Reviewed by NOBODY (OOPS!). https://bugs.webkit.org/show_bug.cgi?id=22679 > Index: WebCore/platform/gtk/KeyEventGtk.cpp > =================================================================== > --- WebCore/platform/gtk/KeyEventGtk.cpp (revision 39021) > +++ WebCore/platform/gtk/KeyEventGtk.cpp (working copy) > @@ -466,6 +466,54 @@ static int windowsKeyCodeForKeyEvent(uns > // VK_NONAME (FC) Reserved for future use > // VK_PA1 (FD) PA1 key > // VK_OEM_CLEAR (FE) Clear key > + case GDK_F1: > + return VK_F1; //F1 what value does this comment add? The other (bad) comments in that file at least state the windows keycode number of the key... Which other keys are not mapped to windows?
Srinivas Rao M Hamse
Comment 3 2008-12-05 04:52:14 PST
Holger Freyther, Do you want me to add comments like other comments in the file ?
Holger Freyther
Comment 4 2008-12-06 04:37:37 PST
(In reply to comment #3) > Holger Freyther, > Do you want me to add comments like other comments in the file ? I would be happy if you just remove the //FX.
Eric Seidel (no email)
Comment 5 2008-12-08 15:52:05 PST
Comment on attachment 25769 [details] Patch for F1-F12 key mappings for WebKit GTK port Looks fine. It would have been easy to write as an if depending on GDK_F1 to GDK_F24 being in the same order. Something like: if (code >= GDK_F1 && code <= GDK_F24) return VK_F1 + (code - GDK_F1); But it's also OK to have been explicit.
Srinivas Rao M Hamse
Comment 6 2008-12-08 21:31:25 PST
Created attachment 25872 [details] Patch for F1-F12 key mappings for WebKit GTK port Holger, did the changes to my patch as required by you.
Srinivas Rao M Hamse
Comment 7 2008-12-08 22:36:13 PST
Created attachment 25875 [details] Patch for F1-F12 key mappings for WebKit GTK port(Eric Suggestion) Eric, This patch is as per your advice.
Srinivas Rao M Hamse
Comment 8 2008-12-08 22:38:32 PST
Created attachment 25876 [details] Patch for F1-F12 key mappings for WebKit GTK port(Eric Suggestion, Using GCC extension) Eric, This is another patch as per your review inputs, but it uses GCC extension. May not be portable if we use it. Please review the same.
Holger Freyther
Comment 9 2008-12-09 04:32:39 PST
Comment on attachment 25875 [details] Patch for F1-F12 key mappings for WebKit GTK port(Eric Suggestion) Remove the conflict marker when landing the patch. Let us use this implementation: - It is not using C99/gccism - Everything else is using switch/case and adding a if feels misplaced.
Holger Freyther
Comment 10 2008-12-09 04:36:56 PST
Comment on attachment 25872 [details] Patch for F1-F12 key mappings for WebKit GTK port Clearing review flag.
Holger Freyther
Comment 11 2008-12-09 04:37:05 PST
Comment on attachment 25876 [details] Patch for F1-F12 key mappings for WebKit GTK port(Eric Suggestion, Using GCC extension) Clearing review flag.
Holger Freyther
Comment 12 2008-12-10 08:54:00 PST
Landed in r39172.
Note You need to log in before you can comment on or make changes to this bug.