Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT accelerator key behavior for Buttons
SWT accelerator key behavior for Buttons [message #464978] Fri, 02 December 2005 08:38 Go to next message
Eclipse UserFriend
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!!
Re: SWT accelerator key behavior for Buttons [message #465338 is a reply to message #464978] Fri, 09 December 2005 01:17 Go to previous message
Eclipse UserFriend
Originally posted by: mwilli.iastate.edu

Gaurav wrote:
>
> 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,
Mike
Previous Topic:PalmOs Porting
Next Topic:Listening to the arrow keys
Goto Forum:
  


Current Time: Mon Jul 14 08:04:45 EDT 2025

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

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

Back to the top