Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 358018

Summary: [KeyBindings] CMD+C not working in (JDT-)popups
Product: [Eclipse Project] Platform Reporter: Thomas Schindl <tom.schindl>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: curtis.windatt.public, daniel_megert, lokffs, markus.kell.r, Michael_Rennie, pwebster
Version: 4.2Flags: Michael_Rennie: review+
Target Milestone: 4.3 RC1   
Hardware: PC   
OS: Mac OS X   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=407213
Whiteboard:

Description Thomas Schindl CLA 2011-09-18 07:54:58 EDT
This is a problem I've only come across on OS-X (on win32 it works). If you hover an element in JDT, select some text from the JDT-Popup and hit CMD+C nothing gets copied in your clipboard.

This is very annoying e.g. if you want to copy something to use it outside eclipse e.g. in a blog. To me it looks like the keybindings are not active in the popup on OS-X.
Comment 1 Dani Megert CLA 2011-09-20 02:04:44 EDT
This probably depends on your browser i.e. whether it works there or not.
Comment 2 Thomas Schindl CLA 2011-09-20 03:23:11 EDT
It works on 3.8 on OS-X so the problem is introduced Eclipse 4.x
Comment 3 Dani Megert CLA 2011-10-12 02:44:49 EDT
> It works on 3.8 on OS-X so the problem is introduced Eclipse 4.x
Maybe a different browser is used in 4.x?
Comment 4 Thomas Schindl CLA 2011-10-12 06:32:56 EDT
(In reply to comment #3)
> > It works on 3.8 on OS-X so the problem is introduced Eclipse 4.x
> Maybe a different browser is used in 4.x?

I don't think the browser is the problem but most likely the new keybinding mechanism that's used in 4.x
Comment 5 Markus Keller CLA 2012-08-31 09:28:34 EDT
This is a bug in the E4 key binding story. To see the bug, set a breakpoint in org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(..), and then e.g. try to copy some text from the Javadoc view.

In E4, that method wrongly returns true, although the copy command is not handled. In the end, KeyBindingDispatcher.processKeyEvent(..) sets eatKey to true, which stops the handling of the KeyDown event.

In 3.x, org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(..) correctly returns false, and the key is not eaten.


On Windows with the IE browser, Ctrl+C still works by accident in E4, due to bug 291483.

Bug 75815 would also help fixing the Cmd+C issue, but the KeyBindingDispatcher is still wrong.
Comment 6 Dani Megert CLA 2012-11-07 09:43:45 EST
I face the same issue when using Ctrl+Insert: it works on 3.8.x but not on 4.3 M3.
Comment 7 Michael Rennie CLA 2013-04-02 09:16:13 EDT
I see this all the time trying to copy things out of popups in the Java editor (Mac OSX Mountain Lion)
Comment 8 Paul Webster CLA 2013-05-02 08:37:37 EDT
KeyBindingDispatcher should respect IHandler.isHandled()

https://git.eclipse.org/r/12453

PW
Comment 9 Markus Keller CLA 2013-05-07 14:09:02 EDT
> https://git.eclipse.org/r/12453

I can confirm that this makes Cmd+C and Cmd+V work on the Mac in the Javadoc view as well as in a Javadoc hover (used <form><input> to get an editable field).
Comment 10 Curtis Windatt CLA 2013-05-08 14:34:28 EDT
Mike, please review this fix on MacOSX

Tried in out in Win7 and Ubuntu Linux but wasn't able to reproduce the problem.  I checked that that fix doesn't affect the key listener for the search field.  Key events that are handled by a binding are eaten, otherwise they call the key listener.
Comment 11 Michael Rennie CLA 2013-05-09 09:54:51 EDT
+1, I can now copy / paste out of popups. The changes have been merged via gerrit.
Comment 13 Paul Webster CLA 2013-05-17 10:48:47 EDT
in 4.3.0.I20130516-2200

PW