d7d1cd
d7d1cd

Reputation: 307

Add hotkeys to Eclipse

I use IBM Rational Developer for i, which is based on Eclipse, to develop applications for IBM i. During development, I constantly use my mouse to send the source code to the IBM i server and start compiling it. To do this, right-click on the project, select Remote Actions and Submit Build in the submenu. This is very exhausting. Could you configure a hotkey to perform this action?

Upvotes: 1

Views: 93

Answers (2)

John Y
John Y

Reputation: 14559

Well, you could always use a more general hotkey facility that isn't specific to RDi. If you're using Windows, I recommend AutoHotkey. This would let you assign keystrokes or mouse movements/clicks to any key combination you like.

Upvotes: 0

David M. Karr
David M. Karr

Reputation: 15235

There are a few strategies for this.

In Preferences and "Keys", you can list key bindings, assign new bindings, and clear existing bindings. It's convenient to sort by the "Binding" column so you can see functions bound to the same sequence right next to each other, to check for possible key sequences to bind functions to.

A general approach is that I bind several functions to key sequences beginning with "Ctrl+;" (control-semicolon). Nothing else uses that prefix, so it doesn't conflict with anything. You can use any prefix that is convenient for you.

The "right-click" operation is actually a specific function, called "show-context-menu". I bind "Ctrl+;, ." (control-semicolon, then period) to this function.

Once the context menu is visible, you can use down-arrow and up-arrow to move through the menu. Up-arrow on the first item goes to the last item. Also, when the context menu is visible, each menu item will have one letter underlined, which is the "accelerator" for that menu item. If you press that key while the menu is shown, it will execute that item, or simply select it if it has a submenu. If there are multiple items with that same accelerator, it will go to the first one, and the next one if you press it again. If it has a submenu, right-arrow will open the submenu.

In your situation, you would have to have the project selected in the project or package explorer. You could do that with the mouse. I'm not aware of good strategies for directly selecting a particular project in the explorer.

Another thing you'll want to do is look in the "Keys" list to see if the function you want to execute is defined, so you could bind a key sequence to it, but you'll still likely have to have the project selected when that sequence is pressed.

This process of exploring functions and keys is much more convenient if you use the "Emacs+" plugin (no elisp knowledge or use required). It provides functions for showing what key sequences are bound to which functions, and vice versa.

Upvotes: 1

Related Questions