Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » binding to mouse input
binding to mouse input [message #765699] Wed, 14 December 2011 09:46 Go to next message
valentin Mising name is currently offline valentin Mising name
Messages: 36
Registered: December 2011
Member
The article on org.eclipse.ui.bindings says that these bindings map between "some user input and a triggered command". However, I see that all user input is reduced to keyboard. It is like there is not mouse in Eclipse universe. Nevertheless, I know that Eclipse jumps to declaration when Left button is clicked while Control is pressed. How do I do the same?
Re: binding to mouse input [message #767231 is a reply to message #765699] Sat, 17 December 2011 06:39 Go to previous messageGo to next message
valentin Mising name is currently offline valentin Mising name
Messages: 36
Registered: December 2011
Member
A response from paulweb515: Quote:
you can't.

The best you can get in the latest eclipse is the left and right mouse buttons on 5-button mice are bound to ALT+LEFT and ALT+RIGHT


I have achieved the goal by

textWidget.addMouseListener(new MouseAdapter() {

	OpenDeclarationAction openDeclaration = new OpenDeclarationAction();
			
	public void mouseDown(MouseEvent e) {
		if (e.stateMask == SWT.CTRL && e.button == 1)
			openDeclaration.run(null);
	}

});


Yet, there seems is even better option: hyperlink detectors

[Updated on: Tue, 27 December 2011 12:58]

Report message to a moderator

Re: binding to mouse input [message #771857 is a reply to message #765699] Wed, 28 December 2011 06:12 Go to previous message
valentin Mising name is currently offline valentin Mising name
Messages: 36
Registered: December 2011
Member
No Message Body

[Updated on: Wed, 28 December 2011 06:12]

Report message to a moderator

Previous Topic:(no subject)
Next Topic:ToolTip Text Not Working on Button?
Goto Forum:
  


Current Time: Thu Jul 24 06:42:48 EDT 2014

Powered by FUDForum. Page generated in 0.07407 seconds