How do you specify Enter as an accelerator for a button?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How do you specify Enter as an accelerator for a button?

Tim M
If you create a dialog and you want to have an OK button with an
accelerator of Enter - how do you specify this?

The OK button in the tool palette doesn't have it preset, and if you
expand the commandDescription and and try to press enter as the
acceleratorKey - it says None but shows a value of 512?

I notice the OK Cancel presenter (provided in the default dialog you
get when you create a new view) seems to have this behavior but I'm not
sure where the code for this is located so I could have a look.

Anyone have any tips?

Tim


Reply | Threaded
Open this post in threaded view
|

Re: How do you specify Enter as an accelerator for a button?

Esteban A. Maringolo-3
TimM escribió:
> If you create a dialog and you want to have an OK button with an
> accelerator of Enter - how do you specify this?

> I notice the OK Cancel presenter (provided in the default dialog you
> get when you create a new view) seems to have this behavior but I'm not
> sure where the code for this is located so I could have a look.

> Anyone have any tips?

Yes, set the #isDefault attribute of the push button to true.

Best regards,

--
Esteban.


Reply | Threaded
Open this post in threaded view
|

Re: How do you specify Enter as an accelerator for a button?

Ian Bartholomew-21
In reply to this post by Tim M
Tim,

> Anyone have any tips?

Try setting the #isDefault aspect for the default button to true.  I
think that makes it the default for the <enter> key.

--
Ian

Use the Reply-To address to contact me.
Mail sent to the From address is ignored.