Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » CTRL+<key> combination possible?
CTRL+<key> combination possible? [message #199939] Thu, 20 October 2005 00:15 Go to next message
Sven Wende is currently offline Sven WendeFriend
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 Go to previous message
Eclipse UserFriend
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
>
Previous Topic:Can not perform actions in multipage GEF editor
Next Topic:passing informations between EGF models
Goto Forum:
  


Current Time: Thu Apr 25 11:13:52 GMT 2024

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

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

Back to the top