• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using a keyboard to push a button
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Using a keyboard to push a button (From: Benjamin Navarro <email@hidden>)
 >Re: Using a keyboard to push a button (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Change background image in select behavior in the NSToolbarItem
  • Next by Date: iPhone resource cache - memory question
  • Previous by thread: Re: Using a keyboard to push a button
  • Next by thread: Re: Using a keyboard to push a button
  • Index(es):
    • Date
    • Thread