Skip to main content



      Home
Home » Eclipse Projects » GEF » getCommonKeyHandler
getCommonKeyHandler [message #124543] Fri, 26 March 2004 11:02 Go to next message
Eclipse UserFriend
Originally posted by: celine.mortelette.atosorigin.com

Hello,

I have two custom actions in my gef editor ACTION1 and ACTION2.
I have added this in my getCommonKeyHandler method, in my gef editor :

sharedKeyHandler.put(
KeyStroke.getPressed( 'G', 0, SWT.CTRL ),
getActionRegistry().getAction(ACTION1));
sharedKeyHandler.put(
KeyStroke.getPressed( 'H', 0, SWT.CTRL ),
getActionRegistry().getAction(ACTION2));

It does'nt work, but when I do this, it works :

sharedKeyHandler.put(
KeyStroke.getPressed( SWT.F4, 0),
getActionRegistry().getAction(ACTION1));
sharedKeyHandler.put(
KeyStroke.getPressed( SWT.F5, 0),
getActionRegistry().getAction(ACTION2));

What is my mistake in the first code ??

Thanks for your help
C
Re: getCommonKeyHandler [message #124617 is a reply to message #124543] Fri, 26 March 2004 16:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

I'm not sure, but most CTRL+key combinations are actually special ASCII
characters. So the character would probably not be "G". The best test
would be to put a breakpoint in the code and see what is being generated
from SWT.

An example which we had was CTRL+BACKSLASH, or maybe /.

"C
Re: getCommonKeyHandler [message #125027 is a reply to message #124617] Wed, 31 March 2004 07:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: celine.mortelette.atosorigin.com

Thanks Randy but my problem is not resolved !
When I put a breakpoint to see what is generated, for 'G' I can't see the
value of the "character" field, for 'J' I see "\n" and for 'C' no event is
generated .....
I have three different results depending on the pressed character.
What can I do ?!


"Randy Hudson" <none@us.ibm.com> a
Re: getCommonKeyHandler [message #125197 is a reply to message #125027] Wed, 31 March 2004 11:25 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> Thanks Randy but my problem is not resolved !
> When I put a breakpoint to see what is generated, for 'G' I can't see the
I think CTRL+G is the "bell" key. You can change the way CHARs are
displayed in the debugger to display HEX values.
> value of the "character" field, for 'J' I see "\n" and for 'C' no event is
J is the 13th letter, ASCII 13 is newline.

CTRL+C is being consumed by the copy keybinding in the eclipse IDE, so you
won't receive that key.

> generated .....
> I have three different results depending on the pressed character.
> What can I do ?!
>
>
> "Randy Hudson" <none@us.ibm.com> a
Previous Topic:Exception while launching
Next Topic:NullPointerException in Draw2D Demo4
Goto Forum:
  


Current Time: Wed Mar 12 16:04:54 EDT 2025

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

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

Back to the top