Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » why the keyEvent respond to accelerater first than control?
why the keyEvent respond to accelerater first than control? [message #446230] Sun, 21 November 2004 09:26 Go to next message
Eclipse UserFriend
Originally posted by: hi_zjy.yahoo.com.cn

I register SWT.DEL as accelerater of action "DleteSelectedControls",
but now if I edit Text, and press delete, it won't respond to the Text,
it executes the action "DleteSelectedControls".

why the keyEvent respond to accelerater first than control?
who can give me some tips?

thanks a lot.
Re: why the keyEvent respond to accelerater first than control? [message #446253 is a reply to message #446230] Mon, 22 November 2004 17:10 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
This is by design and it's what the operating systems do. When you press a
key, only one action should result. For example, if you add an accelerator
for SWT.DEL, the either the widget should process the key or the menu
should, but not both. If the widget processes the key, then there is a menu
item that has DEL as an accelerator but does not run the menu action. The
problem arises because the menu bar is global to a window and runs actions
for every control in the window. For example, it has no way to know that
focus is in a text widget and that SWT.DEL should be given to the text
widget and not run the menu action. Focus doesn't enter into any decision
that the menu bar makes about processing a key because menu bars are global
to a window.

Hope this helps.

"Harry Chang" <hi_zjy@yahoo.com.cn> wrote in message
news:cnpmvm$np8$1@www.eclipse.org...
> I register SWT.DEL as accelerater of action "DleteSelectedControls",
> but now if I edit Text, and press delete, it won't respond to the Text,
> it executes the action "DleteSelectedControls".
>
> why the keyEvent respond to accelerater first than control?
> who can give me some tips?
>
> thanks a lot.
>
Previous Topic:Why is SWT.SMOOTH not possible in a SashForm?
Next Topic:[MacOS X.3.6] TableTree clicks ?
Goto Forum:
  


Current Time: Fri Apr 26 13:47:50 GMT 2024

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

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

Back to the top