[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.gef] Re: CTRL+<key> combination possible?
|
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@xxxxxxxxxxxxx> wrote in message
news:dj6nij$skf$1@xxxxxxxxxxxxxxxxxxx
> 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
>