Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Adding a Ctrl-i keystroke
Adding a Ctrl-i keystroke [message #222339] Wed, 30 August 2006 16:40 Go to next message
Eclipse UserFriend
Originally posted by: pbeag_RemoverIfNotASpammer_an.yahoo.com

I want to have CTRL-i invoke a specific action in my editor. I
can't seem to get the correct syntax. Any ideas?

This works fine for mapping to the F2 key:

KeyHandler sharedKeyHandler = new KeyHandler();

sharedKeyHandler.put(KeyStroke.getPressed(SWT.F2, 0),
getActionRegistry().getAction( GEFActionConstants.DIRECT_EDIT));


but if I want to map to CTRL-i , this doesn't work :


sharedKeyHandler.put(KeyStroke.getPressed('i', SWT.CTRL),
getActionRegistry().getAction( GEFActionConstants.DIRECT_EDIT));



Any ideas? Thanks!
Re: Adding a Ctrl-i keystroke [message #222347 is a reply to message #222339] Wed, 30 August 2006 19:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

CTRL+I might generate a special keycode that is not a character.
You should consider using JFace keybindings and actions whenever
appropriate. Espeically to allow customization, and to avoid/identify
conflicts with other keybindings.


"patrick" <pbeag_RemoverIfNotASpammer_an@yahoo.com> wrote in message
news:vlfbf25hf57iqrlq3f9ekokqhvt5po8m0h@4ax.com...
>I want to have CTRL-i invoke a specific action in my editor. I
> can't seem to get the correct syntax. Any ideas?
>
> This works fine for mapping to the F2 key:
>
> KeyHandler sharedKeyHandler = new KeyHandler();
>
> sharedKeyHandler.put(KeyStroke.getPressed(SWT.F2, 0),
> getActionRegistry().getAction( GEFActionConstants.DIRECT_EDIT));
>
>
> but if I want to map to CTRL-i , this doesn't work :
>
>
> sharedKeyHandler.put(KeyStroke.getPressed('i', SWT.CTRL),
> getActionRegistry().getAction( GEFActionConstants.DIRECT_EDIT));
>
>
>
> Any ideas? Thanks!
Re: Adding a Ctrl-i keystroke [message #721209 is a reply to message #222347] Thu, 01 September 2011 07:36 Go to previous message
Willem D is currently offline Willem DFriend
Messages: 3
Registered: July 2009
Junior Member
It has been a few years since this post, but I have this exact problem now. Please help.
Previous Topic:horizontal scroll with mouse wheel
Next Topic:[ZEST] NPEs due to invalid GraphViewer selections
Goto Forum:
  


Current Time: Sun Dec 21 06:24:54 GMT 2014

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

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