pacificIT / chromiumembedded

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

CEF3 [mac]: Keyboard shortcuts not working when browser has focus #618

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run cefclient and open any page that has editable text (www.google.com is 
fine)
2. Click in the URL text field and copy the text
3. Click in the search field on the webpage and press Cmd-V

What is the expected output? What do you see instead?
The text should be pasted, but isn't. If you select the "Paste" menu item 
everything works.

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

Please provide any additional information below.
The Cut/Copy/Paste shortcuts work fine in the URL textfield, it is only a 
problem when the browser has focus.

Original issue reported on code.google.com by grue...@gmail.com on 1 Jun 2012 at 4:38

GoogleCodeExporter commented 9 years ago
Attached is a patch for Mac OSX that will ensure all top level shortcuts are 
handled. 

Original comment by corey.lu...@gmail.com on 5 Jun 2012 at 3:05

Attachments:

GoogleCodeExporter commented 9 years ago
We should probably call performKeyEquivalent: from HandleKeyboardEvent instead 
of PreHandleKeyboardEvent so that the web content gets an opportunity to handle 
the key combination first if desired.

Original comment by magreenb...@gmail.com on 5 Jun 2012 at 6:57

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Looks good to me.

Original comment by magreenb...@gmail.com on 5 Jun 2012 at 8:14

GoogleCodeExporter commented 9 years ago
Well agreed, I guess it's just a matter of precedence.  I was thinking earlier 
of something like the following if we always wish to give the web content first 
crack?

void Shell::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
  // Check to see if event should be ignored (see NativeWebKeyboardEvent.h)
  if (event.skip_in_browser)
    return;

  // Give our top level menu equivalents a chance at the event.
  if ([event.os_event type] == NSKeyDown)
    if ([[NSApp mainMenu] performKeyEquivalent:event.os_event])
      return;

  // Finally dispatch to our top level shell (TODO) once an interface
  // has been flushed out...
}

Original comment by corey.lu...@gmail.com on 5 Jun 2012 at 8:17

GoogleCodeExporter commented 9 years ago
Another updated patch, per suggestions.  My first CEF patch so you may have to 
tweak. ;)

Original comment by corey.lu...@gmail.com on 5 Jun 2012 at 8:47

Attachments:

GoogleCodeExporter commented 9 years ago
A few style-related comments:

1. Wrap code at 80 characters.
2. Remove the "// Finally dispatch to our top" comment and "// TODO(cef) 
Dispatch to our top" comments, they seem unnecessary.

Original comment by magreenb...@gmail.com on 5 Jun 2012 at 8:56

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Updated patch.

Original comment by corey.lu...@gmail.com on 7 Jun 2012 at 1:57

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks, I combined your patch with a fix for issue #615 in revision 675.

Original comment by magreenb...@gmail.com on 7 Jun 2012 at 5:39