• 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: WM_KEYDOWN
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WM_KEYDOWN


  • Subject: Re: WM_KEYDOWN
  • From: Uli Kusterer <email@hidden>
  • Date: Wed, 11 Apr 2007 11:51:26 +0200

Am 11.04.2007 um 11:06 schrieb xcocoa:
I am looking for a way to get a simply MS Windows WM_KEYDOWN alike message (notification) when using a NSTextField.

Not sure you really want that. If you want to handle keyboard shortcuts, keyDown: would probably fit the bill. But keep in mind that NSTextField doesn't just do ASCII. It does all sorts of international character sets, some of which use several Unicode "characters" to express an actual character (e.g. Japanese and Chinese).


So, you may want to have a look at the NSTextView and NSText delegate methods, some of which give you an NSString with the Unicode "character" sequence for the character last entered when they notify you one was entered. Each NSTextField uses an NSTextView called the "field editor" to do its actual work.

On my web site, my UKSyntaxColoredTextDocument, for example, creates an NSTextView and registers for its delegate methods to actually change the text as you're typing it. It's probably not 100% international-safe yet, but at least safer than using keyDown: directly.

Cheers,
-- M. Uli Kusterer
http://www.zathras.de



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: WM_KEYDOWN
      • From: John Stiles <email@hidden>
References: 
 >WM_KEYDOWN (From: xcocoa <email@hidden>)

  • Prev by Date: Re: WM_KEYDOWN
  • Next by Date: Re: Catching NSSlider -mouseUp: events (workaround)
  • Previous by thread: Re: WM_KEYDOWN
  • Next by thread: Re: WM_KEYDOWN
  • Index(es):
    • Date
    • Thread