Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » CRT+A / CTR+Z / CTR+Y are not caught by a keylistner in a wizard
CRT+A / CTR+Z / CTR+Y are not caught by a keylistner in a wizard [message #666447] Wed, 20 April 2011 09:40 Go to previous message
BLANC Philippe is currently offline BLANC Philippe
Messages: 89
Registered: July 2009
Member
Hello,
I'm developping a RCP application.
My application mange undo/redo cut/copy paste in my editors/views. everything is ok.
Now, I would like to manage these actions in some of my wizards.

I have a wizard with a TreeViewer.
I've added popup menu and key listeners to manage the cut/copy/paste and the undo/redo operations.
I have a problem for the undo/redo shortcuts: they are not detected by my key listener.

Here is my code:

mComputationTreeViewer.getControl().addKeyListener(new KeyListener() {
	@Override
	public void keyReleased(KeyEvent e) {}
	@Override
	public void keyPressed(KeyEvent e) {
		if((e.keyCode == 'c') && (e.stateMask == SWT.CTRL)) {
                       mCopyAction.run();
                }else if((e.keyCode == 'v') && (e.stateMask == SWT.CTRL)) {
                       mPasteAction.run();
                }else if((e.keyCode == 'z') && (e.stateMask == SWT.CTRL)) {
                       // Never call, WHY ????
                       mUndoAction.run();
                }else if((e.keyCode == 'y') && (e.stateMask == SWT.CTRL)) {
                       // Never call, WHY ????
                       mRedoAction.run();
                }
}});


If somebody has any suggestion...

Thank you.
Regards,

Philippe B.

PS: I'm working on Eclipse 3.5
 
Read Message
Read Message
Read Message icon14.gif
Previous Topic:Start eclipse on Windows 7
Next Topic:DND with multiple Transfer Types
Goto Forum:
  


Current Time: Thu May 23 21:03:48 EDT 2013

Powered by FUDForum. Page generated in 0.01701 seconds