Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to add keydown/up event listener on eclipse rcp editor view?
How to add keydown/up event listener on eclipse rcp editor view? [message #925065] Thu, 27 September 2012 10:39 Go to next message
Liudas Sodas is currently offline Liudas SodasFriend
Messages: 7
Registered: September 2012
Junior Member
So I basically need to get key press up/down event from eclipse editor view. I googled it for couple hours but only found keypress events from shell (like here www.java2s.com/Tutorial/Java/0280__SWT/Geteventtype.htm). But this method do not work in/from editor view. So maybe some one knows how to add keypress event listener in editor?

P.S. I'm using eclipse 4.2.

Thanks in advance
Re: How to add keydown/up event listener on eclipse rcp editor view? [message #925254 is a reply to message #925065] Thu, 27 September 2012 14:37 Go to previous messageGo to next message
Liudas Sodas is currently offline Liudas SodasFriend
Messages: 7
Registered: September 2012
Junior Member
I found out the way (thanks guys in irc)

// ITextEditor editor;
((StyledText)editor.getAdapter(org.eclipse.swt.widgets.Control.class)).addKeyListener(new KeyListener() {
	
	@Override
	public void keyReleased(KeyEvent e) {
		System.out.println("key release ");
	}
	
	@Override
	public void keyPressed(KeyEvent e) {
		System.out.println("key pressed ");
	}
});
Re: How to add keydown/up event listener on eclipse rcp editor view? [message #1793353 is a reply to message #925254] Mon, 06 August 2018 11:00 Go to previous message
Rahul Gangahar is currently offline Rahul GangaharFriend
Messages: 1
Registered: August 2018
Junior Member
Is this Key Released or Key Press will work on Mouse Scroll up /Down concept???
Previous Topic:Errors not listed on Problems view
Next Topic:eclipse rcp app not running using lombok
Goto Forum:
  


Current Time: Wed Nov 14 20:14:26 GMT 2018

Powered by FUDForum. Page generated in 0.01451 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top