Skip to main content



      Home
Home » Eclipse Projects » GEF » KeyHandler and CTRL-Z
KeyHandler and CTRL-Z [message #102982] Fri, 31 October 2003 05:48 Go to next message
Eclipse UserFriend
Originally posted by: arnaud.siminski.infotel.com

Hi all !

In a GEF editor I would like to run the UNDO action when the user press on
CTRL-Z. To do so I implement something like that :

keyhandler.put(KeyStroke.getPressed(SWT.CONTROL | 'z', 0),
getActionRegistry().getAction(GEFActionConstants.UNDO));

It seems to me that the system catchs only the CONTROL key when I press
CTRL Z. I also tried several others ways like telling that the keycode was
SWT.CONTROL|'z' and the statemask was SWT.CONTROL and so... but none has
worked.

I have to add that the action UNDO do run when I link it to the SHIFT-Z or
any other key... so i think the problem should come only from the
keyhandler setup.

Could someone explain to me please how do to that?

Arnaud Siminski
Re: KeyHandler and CTRL-Z [message #103009 is a reply to message #102982] Fri, 31 October 2003 09:58 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

That's right. CTRL+Z is an accelerator defined in the Shell. This means
you must use a global action handler to hook into the workbench's handling
of CTRL+Z. See how the logic example does this.

"Arnaud Siminski" <arnaud.siminski@infotel.com> wrote in message
news:bnteld$nbd$1@eclipse.org...
> Hi all !
>
> In a GEF editor I would like to run the UNDO action when the user press on
> CTRL-Z. To do so I implement something like that :
>
> keyhandler.put(KeyStroke.getPressed(SWT.CONTROL | 'z', 0),
> getActionRegistry().getAction(GEFActionConstants.UNDO));
>
> It seems to me that the system catchs only the CONTROL key when I press
> CTRL Z. I also tried several others ways like telling that the keycode was
> SWT.CONTROL|'z' and the statemask was SWT.CONTROL and so... but none has
> worked.
>
> I have to add that the action UNDO do run when I link it to the SHIFT-Z or
> any other key... so i think the problem should come only from the
> keyhandler setup.
>
> Could someone explain to me please how do to that?
>
> Arnaud Siminski
>
Previous Topic:GEF takes on Visio?
Next Topic:"not a dibseciton"
Goto Forum:
  


Current Time: Sat May 24 18:40:32 EDT 2025

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

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

Back to the top