views:

762

answers:

6

I am switching back and forth between eclipse and intellij and am really missing the ability to "right click" using the keyboard when I am in eclipse. I am running OSX Leopard.

Does anyone know if this can be setup in the keys preferences, or is there a plugin that handles simulating a context menu at the current focused component?

+1  A: 

Does your keyboard have a menu key?

Stephen Denne
+1  A: 

Well, I know that Windows have a key right between the right Windows key and the right ctrl key.

It is a context menu key. That may do what you want it to do.

jjnguy
Not on laptops :-)
ChssPly76
Many laptops have a Context Menu key, I'm looking at one on mine right now.
Rob Hruska
They do, but on vast majority of them it's not located between right control and right windows key - in fact, I'm pretty sure vast majority of them doesn't even have right windows key.
ChssPly76
+5  A: 

Windows

For Windows, I don't think you necessarily need an Eclipse-specific solution. Your keyboard might have a Context Menu key, or you can use Shift-F10 to bring up the context menu.

Source

OSX

After you updated your question to be specific to OSX, I did some searching, and it doesn't seem like there's a built-in OSX way to bring up a context menu. You might be able to find a program that will let you configure keystrokes to simulate mouse clicks, and then configure a shortcut to Ctrl+Click.

Eclipse Configuration

In Preferences -> General -> Keys there are several "Menu" actions that are bindable. Perhaps you can use these? When I filter the options for "Menu", I see, among others:

  • Show Refactor Quick Menu (Alt+Shift+T)
  • Show Source Quick Menu (Alt+Shift+S)
  • etc.

Alternatively, you could just find those commands from the context menu that you use most frequently and bind some keyboard shortcuts to them in Preferences -> General -> Keys.

Rob Hruska
On OSX, I can't seem to figure out a way to use the keyboard for context menus, in general. Intellij has a built in solution for context menus. I was hoping eclipse would also.
Tony Eichelberger
+1  A: 

While this unfortunately won't provide a solution for your problem I think it's still worth pointing out the following from The SWT FAQ (Eclipse facilitates SWT to implement its UI):

Q: What are the standard keyboard shortcuts on Windows, Mac OS X, GTK?
A: Since SWT uses native controls, standard keyboard shortcuts can be used in SWT applications. Here is a useful Table of Keyboard Shortcuts.

Obviously your problem is manifesting itself in row 'Pop up contextual menu for currently selected objects' of this table, where all platforms but Mac OS do offer either shortcuts Shift-F10 or Menu or both.

While I can understand that SWT is using the native GUI libraries of the operating system and consequently does not offer this by default, I'm quite surprised that a huge and excellent developer tool like Eclipse is not providing a workaround here. How does IntelliJ solve this issue?

Steffen Opel
I can add any key binding I want for the "right" click in Intellij. Intellij is built on top of Swing, though.
Tony Eichelberger
+2  A: 

On the old Apple branded external keyboards, the menu button is to the right of the space bar (Alt Gr, on PC style keyboards). Looking at the newer keyboards, and the Mac Book Pros, it doesn't seem to be there (guess it went the same way as the Home, End, Page Up, Page Down and Delete keys).

Having a poke around the Preferences -> Keys preference page, I don't think there is a way of revealing the entire context menu.

Many of the sub-menus are available from the keyboard - the ones I have committed to muscular memory are:

  • Alt ⌘ T - refactoring menu, and the various refactorings available from the keyboard, using the modifiers Alt ⌘
  • Alt ⌘ S - Source menu, and various operations beginning with Shift ⌘ - including organize imports, reformat.
  • Shift ⌘ T - open type
  • Shift ⌘ R - open resource

If all else fails, it is usually worth looking at Shift ⌘ L - which shows all current keyboard mappings in a hover on the side of the screen.

With these shortcuts, I would recommend learning one a day. Their culmulative effect is considerable.

I appreciate that this does not answer your question, but I hope it solves your problem.

jamesh
A: 

Click on the trackpad with two fingers, sort of like Moe poking Curly in the eyes.

Norman Cohen