• 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: NSTextInput conformant view not responding to IME input
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextInput conformant view not responding to IME input


  • Subject: Re: NSTextInput conformant view not responding to IME input
  • From: Abhijit Apte <email@hidden>
  • Date: Wed, 04 Dec 2013 11:19:13 +0530

On Wed, Dec 4, 2013 at 10:53 AM, Ken Thomases <email@hidden> wrote:

> On Dec 3, 2013, at 9:46 PM, Abhijit Apte wrote:
>
> > I've a view which is conforming to NSTextInput protocol which has the
> > -setMarkedText: and -insertText: methods implemented in the view.
>
> You should be using the NSTextInputClient protocol in modern code.
>

I agree, I can switch to using the newer protocol.


>
> > If I switch the keyboard focus from a view in another window and give
> this
> > view the keyboard focus, upon -keyDown: with Japanese input method (say),
> > if I call [[self inputContext] handleEvent:event], the callbacks
> > -setMarkedText: and -insertText: are not getting called at all.
> > However, if I switch the app and activate the app back, the IME input
> works
> > and I receive the callback.
> >
> > Can anyone suggest what could be happening here?
> > The responder chain seems to be the same in both the scenarios.
>
> Are you overriding -[NSView inputContext]?  Perhaps you did it
> accidentally, if you created an inputContext property?
>
> Nope, I didn't override this method.


> Try invoking [NSTextInputContext currentInputContext] either arbitrarily
> or instead of [self inputContext].  As I recall, it is within
> +currentInputContext that Cocoa deactivates that old input context and
> activates the new one (if the first responder of the key window has
> changed).
>

I noticed that the [NSTextInputContext currentInputContext] is the same as
[self inputContext] which means the new context of the responder got
activated.
_______________________________________________

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: NSTextInput conformant view not responding to IME input
      • From: Ken Thomases <email@hidden>
References: 
 >NSTextInput conformant view not responding to IME input (From: Abhijit Apte <email@hidden>)
 >Re: NSTextInput conformant view not responding to IME input (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: NSTextInput conformant view not responding to IME input
  • Next by Date: Re: ToolTips for Matrix Cells
  • Previous by thread: Re: NSTextInput conformant view not responding to IME input
  • Next by thread: Re: NSTextInput conformant view not responding to IME input
  • Index(es):
    • Date
    • Thread