• 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: capture modifier key events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: capture modifier key events


  • Subject: Re: capture modifier key events
  • From: "Mattias Arrelid" <email@hidden>
  • Date: Wed, 18 Jun 2008 10:44:44 +0200

Hi Apparao,

On Wed, Jun 18, 2008 at 7:55 AM, Apparao Mulpuri
<email@hidden> wrote:
> I have a NSTextField, in which i have to update with new string
> value when ever user presses Cmd, Control or Option keys. I have tried
> with keyDown and controlDidChange methods. These are working with
> combination of other keys includes nemuric, character and functional
> keys.
>
> Is there any provision, to capture only modifier keys (with out
> pressing on other keys) events in Cocoa.

If you have a subclass of NSTextField (or any class that inherits from
NSResponder) you could override the flagsChanged: method. It will be
called as soon as the user holds down any of the control keys. Read
more about it in the documentation set on NSResponder.

Good luck
Mattias
_______________________________________________

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: 
 >capture modifier key events (From: "Apparao Mulpuri" <email@hidden>)

  • Prev by Date: Re: Rethinking my approach; rather overwhelmed.
  • Next by Date: Re: Passing CGImageSourceRef to IKImageView
  • Previous by thread: capture modifier key events
  • Next by thread: does NSTextField always use UTF8 encoding
  • Index(es):
    • Date
    • Thread