Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » [Key Bindings] Howto to avoid accelerators stealing keys from Text?
[Key Bindings] Howto to avoid accelerators stealing keys from Text? [message #443502] Sun, 26 September 2004 00:50 Go to next message
Benjamin Pasero is currently offline Benjamin PaseroFriend
Messages: 337
Registered: July 2009
Senior Member
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 #443532 is a reply to message #443502] Mon, 27 September 2004 15:03 Go to previous messageGo to next message
Douglas Pollock is currently offline Douglas PollockFriend
Messages: 84
Registered: July 2009
Member
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.
Re: [Key Bindings] Howto to avoid accelerators stealing keys from Text? [message #443941 is a reply to message #443532] Mon, 04 October 2004 19:39 Go to previous message
jmi is currently offline jmiFriend
Messages: 84
Registered: July 2009
Member
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.
Previous Topic:Label with HTML??
Next Topic:org.eclipse.swt.custom.ViewForm , ToolBar and JFace Action
Goto Forum:
  


Current Time: Fri Apr 19 21:00:00 GMT 2024

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

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

Back to the top