Re: Using a keyboard to push a button
Re: Using a keyboard to push a button
- Subject: Re: Using a keyboard to push a button
- From: Seth Willits <email@hidden>
- Date: Wed, 5 May 2010 15:42:59 -0700
On May 5, 2010, at 2:05 PM, Jens Alfke wrote:
> In Interface Builder, select the button and then use the Attributes inspector to set its key equivalent. (Click the box to the right of “Key Equiv.:” and press the Enter key.)
On May 5, 2010, at 2:03 PM, Seth Willits wrote:
> Set the action of the field to performClick: of the button.
>
> In Interface Builder, hold Control, click on the field and drag the connection line to the button, release. Select performClick:
The difference between these two solutions (and which one is appropriate) depends on the situation. I assumed one way, but you probably were looking for Jens' answer. Anyway, the difference is this:
Jens' sets a default button for the entire window. That means that for *any* field you're in, or even if you're not in one, when you press Return, the default button is "clicked."
The way I describe makes it so that when you press Return only in that *specific* field, does the button get clicked.
Both are useful in different situations.
--
Seth Willits
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden