Bug 22679 - [GTK] Function Keys (F1 to F12) are not mapped
Summary: [GTK] Function Keys (F1 to F12) are not mapped
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Major
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-05 02:47 PST by Srinivas Rao M Hamse
Modified: 2008-12-10 08:54 PST (History)
0 users

See Also:


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+
Details | Formatted Diff | Diff
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 Details | Formatted Diff | Diff
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+
Details | Formatted Diff | Diff
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 Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Srinivas Rao M Hamse 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.
Comment 1 Srinivas Rao M Hamse 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>
Comment 2 Holger Freyther 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?
Comment 3 Srinivas Rao M Hamse 2008-12-05 04:52:14 PST
Holger Freyther, 
Do you want me to add comments like other comments in the file ?

Comment 4 Holger Freyther 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.

Comment 5 Eric Seidel (no email) 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.
Comment 6 Srinivas Rao M Hamse 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.
Comment 7 Srinivas Rao M Hamse 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.
Comment 8 Srinivas Rao M Hamse 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.
Comment 9 Holger Freyther 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.
Comment 10 Holger Freyther 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.
Comment 11 Holger Freyther 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.
Comment 12 Holger Freyther 2008-12-10 08:54:00 PST
Landed in r39172.