|Re: SWT accelerator key behavior for Buttons [message #465338 is a reply to message #464978]
||Fri, 09 December 2005 06:17
Originally posted by: mwilli.iastate.edu|
> Default Windows OS Behaviour for accelerator keys (ALT+key) appears to
> be trigger of action bound to Button but keeping the focus on control
> where it was.
> Though in SWT appplications, action bound to buttons is triggered but
> focus also moves to button.
> Is there a way of avoiding it and retaining the focus on original control!!
In the SelectionListener for the the button, you could call
Display.getCurrent().getActiveShell.forceActive(); and that should force
the shell main shell to gain focus. If you know beforehand what shell it
is, you and have access to that shell from the class with the
selectionListener, you can just call forceActive(); on that shell.
Hope this helps,
Powered by FUDForum
. Page generated in 0.01511 seconds