- View SourceHi,
Not through configuration, but you can use the KeyListener infrastructure, to bind a listener to the Enter key, and invoke the same function which you use for your handler (setting a scope if required).
A couple of notes:
a). The element you're listening on does not necessarily need to be the document as in the above example. It could be the container's bounding box also, but in order for the key listener to be invoked in that case, something within the bounding box will need to have focus.
b). I assume you're not talking about hitting Enter when the button has focus, which you'll get for free - viz. The button's 'click' listeners will get invoked if you hit Enter when the button has focus.
Hope that helps,
Sent: Thursday, June 26, 2008 9:54 AM
I have two buttons defined on my dialog, is it possible to define that
one of them will be executed (it's handler) when the Enter key is pressed?
I did some searching and this issue seems to have come up before but I
couldn't find a proper solution in the posts.