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.
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>
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?
Holger Freyther, Do you want me to add comments like other comments in the file ?
(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.
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.
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.
Created attachment 25875 [details] Patch for F1-F12 key mappings for WebKit GTK port(Eric Suggestion) Eric, This patch is as per your advice.
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.
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.
Comment on attachment 25872 [details] Patch for F1-F12 key mappings for WebKit GTK port Clearing review flag.
Comment on attachment 25876 [details] Patch for F1-F12 key mappings for WebKit GTK port(Eric Suggestion, Using GCC extension) Clearing review flag.
Landed in r39172.