CRT+A / CTR+Z / CTR+Y are not caught by a keylistner in a wizard [message #666447] |
Wed, 20 April 2011 09:40  |
Eclipse User |
|
|
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03201 seconds