CTRL+<key> combination possible? [message #199939] |
Thu, 20 October 2005 00:15 |
Sven Wende Messages: 9 Registered: July 2009 |
Junior Member |
|
|
Hi,
looking at and copying from Logic example and
LogicEditor.getCommonKeyHandler() , i started to implement
key combinations for certain actions.
But i get stuck, when i try to implement key combinations with modifiers
like ALT or CTRL !
Whereas this does work fine in LogicEditor.getCommonKeyHandler() :
....
sharedKeyHandler.put(KeyStroke.getPressed('j', 106, 0),
getActionRegistry().getAction(MyAction.ID)); // single j as key
....
something like this does NOT work:
....
sharedKeyHandler.put(KeyStroke.getPressed('j', SWT.CONROL),
getActionRegistry().getAction(MyAction.ID)); // single CTRG+j as key
....
Where is the problem? I know, that there are some exceptions for key
combinations like CONROL+X, CONROL+V, but i tried it with many different
characters and none of it worked.
Thanks in advance
Sven Wende
|
|
|
Re: CTRL+<key> combination possible? [message #200036 is a reply to message #199939] |
Thu, 20 October 2005 13:41 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
I think CTRL+J produces some other character that is not J.
There is an SWT snippet that prints out every key event you type. You can
quickly find out what event is generated for any key combination.
BTW, there are many scenarios where the keyhandler is not appropriate
because it will not work unless the viewer has focus. Also, it is not easily
customized by the user and the user will not be informed of conflicts that
he/she creates when customizing other keystroked in the IDE.
You should use commands when appropriate.
"Sven Wende" <s.wende@brain-time.de> wrote in message
news:dj6nij$skf$1@news.eclipse.org...
> Hi,
>
> looking at and copying from Logic example and
> LogicEditor.getCommonKeyHandler() , i started to implement
> key combinations for certain actions.
>
> But i get stuck, when i try to implement key combinations with modifiers
> like ALT or CTRL !
>
> Whereas this does work fine in LogicEditor.getCommonKeyHandler() :
> ...
> sharedKeyHandler.put(KeyStroke.getPressed('j', 106, 0),
> getActionRegistry().getAction(MyAction.ID)); // single j as key
> ...
>
> something like this does NOT work:
> ...
> sharedKeyHandler.put(KeyStroke.getPressed('j', SWT.CONROL),
> getActionRegistry().getAction(MyAction.ID)); // single CTRG+j as key
> ...
>
> Where is the problem? I know, that there are some exceptions for key
> combinations like CONROL+X, CONROL+V, but i tried it with many different
> characters and none of it worked.
>
> Thanks in advance
>
> Sven Wende
>
|
|
|
Powered by
FUDForum. Page generated in 1.08594 seconds