xxfxxf / chromiumembedded

Automatically exported from code.google.com/p/chromiumembedded
0 stars 0 forks source link

F10 key presses cannot be trapped? #343

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Bind an F10 key press to a function in JavaScript.
2. Press F10 in a CEF window running the script (the CEF sample app will do).

What is the expected output? What do you see instead?

I expect the F10 key press to run the function every time it is pressed, 
however the first F10 key press is swallowed by Windows, and only the second 
one is received. This behaviour does not happen in a full version of the Chrome 
browser, where the F10 key is bound correctly, I also tested in Firefox 6 and 
once again the key was correctly bound such that every key press was received 
by the page.

What version of the product are you using? On what operating system?

Revision 195 on Windows 7. I also tested with the revision 275 sample app.

Please provide any additional information below.

I'm trying to use Visual Studio style key bindings in this script, so it would 
be very nice to get a fix for this.

I have tried trapping this key in various places to try and override the 
default Windows behaviour, however no code outside of CEF seems to see the 
first key press; additionally telling the HandleKeyEvent function that the F10 
key press has been handled (RV_HANDLED rather than RV_CONTINUE) makes no 
difference. We therefore think this is some behaviour that CEF is doing 
internally (although admittedly it is default Windows behaviour).

This is the function used to map the F10 key:

$(window).keydown(function(event) {
if(event.which == 121 /* F10 */) {
        event.preventDefault();
        /* Do something */
    }
});

Original issue reported on code.google.com by zombie.k...@gmail.com on 16 Sep 2011 at 10:02

GoogleCodeExporter commented 9 years ago
Is there any update on this? It is still an issue for us.

Original comment by zombie.k...@gmail.com on 5 Jan 2012 at 11:37

GoogleCodeExporter commented 9 years ago
CEF1 has entered bug-fix-only maintenance mode. See 
http://magpcss.org/ceforum/viewtopic.php?f=10&t=10647 for details. If this 
issue applies to the current version of CEF3 please create a new issue.

Original comment by magreenb...@gmail.com on 11 Oct 2013 at 1:58