Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forumswhy the keyEvent respond to accelerater first than control?
https://www.eclipse.org/forums/index.php/mv/msg/141613/446230/#msg_446230
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.]]>2004-11-21T09:26:14-00:00Re: why the keyEvent respond to accelerater first than control?
https://www.eclipse.org/forums/index.php/mv/msg/141613/446253/#msg_446253
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.
>]]>Steve Northover2004-11-22T17:10:38-00:00