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

Re: Receiving Unicode Input in NSView


  • Subject: Re: Receiving Unicode Input in NSView
  • From: Aki Inoue <email@hidden>
  • Date: Fri, 29 Jul 2011 11:22:12 -0700

Bill,

> 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.
We have always required the first responder to adopt either NSTextInput or NSTextInputClient for handling text input with complex user interaction required such as the deadkey sequence.

> 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.
Yes, we do have a sample.  Check out file://localhost/Developer/Examples/AppKit/TextInputView/

Aki

On 2011/07/29, at 7:31, Bill Appleton wrote:

> 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

_______________________________________________

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: 
 >Receiving Unicode Input in NSView (From: Bill Appleton <email@hidden>)

  • Prev by Date: Re: Why Don't Cocoa's (Un)Archiving Methods return Errors?
  • Next by Date: Re: MPMoviePlayerController Fast forward
  • Previous by thread: Receiving Unicode Input in NSView
  • Next by thread: NSView-based NSTableView: How to animate when using bindings?
  • Index(es):
    • Date
    • Thread