Keyboard Listener [message #277192] |
Mon, 06 December 2004 10:53  |
Eclipse User |
|
|
|
Originally posted by: brendan.moorehead.gmail.com
i wish to attach a keyboard listener to the current editor
i have a listener setup so i always know the current editor
i have also created my key listener
however i do not know where to add this listener
please can someone tell me where to call this code
cheers
|
|
|
|
Re: Keyboard Listener [message #277227 is a reply to message #277205] |
Tue, 07 December 2004 03:04  |
Eclipse User |
|
|
|
Originally posted by: brendan.moorehead.gmail.com
i need to listen for cuy, copy & paste shortcuts - CTRL + C, CTRL + X,
CTRL + V
my setting a global action handler it only gets the action from the toolbar
it is not my editor i need to listen for, its any active edtior
so i need a keyboard listener, which is added dynamically to
whatever the current editor is
Douglas Pollock wrote:
> Brendan Moorehead wrote:
>> i wish to attach a keyboard listener to the current editor
>> i have a listener setup so i always know the current editor
>> i have also created my key listener
>> however i do not know where to add this listener
>> please can someone tell me where to call this code
> Why? :)
> It sounds like you just want to define a command and key binding in XML.
> Look at the plugin.xml for "org.eclipse.ui" for examples. Once you have
> that, you can call
> "workbench.getCommandSupport().addHandlerSubmission(...)" to get your code
> hooked up to the command. Remove to remove the handler when you're done,
> or you will leak memory.
> I'm not sure how you would attach a key listener to an editor, unless you
> created it yourself.
> cheers,
> d.
|
|
|
Powered by
FUDForum. Page generated in 0.03011 seconds