why the keyEvent respond to accelerater first than control? [message #446230] |
Sun, 21 November 2004 09:26 |
Eclipse User |
|
|
|
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 |
Steve Northover 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.
>
|
|
|
Powered by
FUDForum. Page generated in 0.02778 seconds