Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsEditor-specific Shortcut isn't recognized
https://www.eclipse.org/forums/index.php/mv/msg/171035/543703/#msg_543703
I want to call a shortcut, that's bound to command shown in my contextmenue of my current editor.
I tried to trigger it by calling
KeyboardFactory.getSWTKeyboard().pressShortcut(SWT.SHIFT | SWT.CTRL, 'O');
(it's a Ctrl+Shift+O - organize imports in a xtexteditor).
This doesn't work.
I then tried to call another shortcut in my contextmenue, this doesn't work also.
General Shortcuts like Shift+Ctrl+R work this way.
What's the problem?
Regards
Markus]]>Markus Oley2010-06-30T11:05:29-00:00Re: Editor-specific Shortcut isn't recognized
https://www.eclipse.org/forums/index.php/mv/msg/171035/543763/#msg_543763
> Hi,
> I want to call a shortcut, that's bound to command shown in my
> contextmenue of my current editor.
> I tried to trigger it by calling
> KeyboardFactory.getSWTKeyboard().pressShortcut(SWT.SHIFT | SWT.CTRL, 'O');
> (it's a Ctrl+Shift+O - organize imports in a xtexteditor).
> This doesn't work. I then tried to call another shortcut in my
> contextmenue, this doesn't work also.
> General Shortcuts like Shift+Ctrl+R work this way.
> What's the problem?
>
> Regards
> Markus
Does your current editor has the focus (or keyboard focus) when you try
the shortcut?
That's probably the only thing I can see... otherwise, make sure it
really is working when you try it and that there isn't some fancy-weird
dependency that would prevent it from working (such as KeyBinding
conflicts).