Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:38 Go to next message
Gaurav is currently offline GauravFriend
Messages: 3
Registered: July 2009
Junior Member
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 06: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: Tue Apr 16 14:21:30 GMT 2024

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

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

Back to the top