|
Re: Mapping from key-codes to Commands? [message #155394 is a reply to message #155364] |
Mon, 25 October 2004 03:54 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
The workbench defines global actions which interfere with normal reception
of KeyDown events. Are you registering global action handlers for delete,
copy, paste?
Which version of Eclipse are you using. In 3.0, a disabled global action
should not intercept the event.
"FreeGroup" <a.herz@FreeGroup.de> wrote in message
news:clgrjb$1lc$1@eclipse.org...
> Hi,
>
> I have a problem to understand the binding between the
> key-codes and the generates Commands.
>
> I have implement the DeleteCommand for some graphical GEF
> objects, but the execute of the Command will not be called.
>
> I don't understand the binding between key-codes and the Commands.
> I can't fixe the bug without the required background.
>
> I have insert the code for the KeyHandler via cut&paste in my Editor:
>
> protected void configureGraphicalViewer()
> {
> //root editpart:
> FreeformGraphicalRootEditPart root = new
FreeformGraphicalRootEditPart();
> getGraphicalViewer().setRootEditPart(root);
> //keyhandler:
> KeyHandler keyHandler = new KeyHandler();
> keyHandler.put(KeyStroke.getPressed(SWT.DEL, 127, 0),
> getActionRegistry().getAction(GEFActionConstants.DELETE));
>
> getGraphicalViewer().setKeyHandler(new
> GraphicalViewerKeyHandler(getGraphicalViewer()).setParent(ke yHandler));
> }
>
> MyDeleteCommand will be instantiated if I select the corresponding
> GEF object - but if I press the DEL key nothing happens.
>
> I have modified the "rlemaigr.classdiagrameditor.MyEditor". The DEL
function of
> GEF objects works fine. But I have changed some code and at the moment it
is impossible
> for me to fixe the error.
>
> I NEED a background articel to understand the Action/Key/Command...
handling!!!!!!!
>
>
> greetings
>
> Andreas
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02000 seconds