[Key Bindings] Howto to avoid accelerators stealing keys from Text? [message #443502] |
Sat, 25 September 2004 20:50  |
Eclipse User |
|
|
|
Hi,
is there any way in SWT to ignore accelerators that are set to the Shell's
Menu in case they are written into a Text field?
For example, have an accelerator "Shift-C" does the action "Open File...".
Now, when focus is set to a Text Field, I would like to have the native
"Copy" action being performed instead of the parent / Shell's action. Or
for example an accelerator "N" for "Goto next news", would stop the Text
widget of containing any "n"-Character.
The Text widget should keep and use those keys that are consumable, and
pass any others to parent Widgets and Controls.
Found a bug entry (19527
https://bugs.eclipse.org/bugs/show_bug.cgi?id=19527) that deals with this
problem, but it was set to "Wontfix" since Eclipse now offers
Editor/Content dependant key bindings (e.g. "In Java Source"). But thats
no solution for other applications that use SWT without the Eclipe
Framework.
Ben
|
|
|
|
Re: [Key Bindings] Howto to avoid accelerators stealing keys from Text? [message #443941 is a reply to message #443532] |
Mon, 04 October 2004 15:39  |
Eclipse User |
|
|
|
Do you do it??? I have the same thing to do.
JLi
"Douglas Pollock" <douglas.pollock@magma.ca> wrote in message
news:cj99rg$bp$1@eclipse.org...
> For 3.0, SWT provided a filtering mechanism on Display (i.e.,
> Display.addFilter()). This filtering mechanism is then used by Platform
UI
> to provide key bindings in Eclipse. We no longer use menu accelerators,
> and so are capable of providing the support you mention.
>
> You can either try to integrate the Eclipse key binding mechanism into
your
> SWT application, or just rip off sections of code you need. Look at
> WorkbenchKeyboard in the "org.eclipse.ui.workbench" for an example of how
> to do this.
>
>
>
> d.
|
|
|
Powered by
FUDForum. Page generated in 0.54839 seconds