• 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
Receiving Unicode Input in NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Receiving Unicode Input in NSView


  • Subject: Receiving Unicode Input in NSView
  • From: Bill Appleton <email@hidden>
  • Date: Fri, 29 Jul 2011 07:31:27 -0700

Hi all,

I have seen this issue come up a lot, but there isn't much information on
how to receive unicode input in a NSView.

(I know we are supposed to just type in a NSTextField but that is impossible
in our situation where the app must run stand-alone and as a browser
plugin).

we used to call interpretKeyEvents in the keyDown handler and the InsertText
handler would get the unicode string, I guess this stopped working with a
system update a while back.

Now i think there are 2 ways to do this:

1) subclass nsview and make it conform to the NSTextInputClient protocol

i have been picking away at this, i added the NSTextInputClient handlers but
they aren't being called. a working example or a pointer would help if
anyone has done this.

2) use a fake NSTextField and try to use that for gathering the unicode as
it arrives.

I have seen someone recommend NSWindow fieldEditor:forObject: to do this.
This sounds pretty bad and i have a lot of uncertainty as to how to make
this work right.

So do you guys have a recommendation here?

thanks in advance
_______________________________________________

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

  • Follow-Ups:
    • Re: Receiving Unicode Input in NSView
      • From: Aki Inoue <email@hidden>
  • Prev by Date: Re: Filter an array
  • Next by Date: Re: Drawing performance in CALayer
  • Previous by thread: UIModalTransitionStylePartialCurl with UITabBarController
  • Next by thread: Re: Receiving Unicode Input in NSView
  • Index(es):
    • Date
    • Thread