Adding a Ctrl-i keystroke [message #222339] |
Wed, 30 August 2006 16:40 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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!
|
|
|
|
Powered by
FUDForum. Page generated in 0.03378 seconds