• 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, multi-character marks, and the cursor position
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextInput, multi-character marks, and the cursor position


  • Subject: Re: NSTextInput, multi-character marks, and the cursor position
  • From: Aki Inoue <email@hidden>
  • Date: Mon, 26 Sep 2005 20:42:55 -0700

Jon,

The cursor movement inside the marked area is communicated via the second argument of -setMarkedText:selectedRange:.

For typing "aaa" in Kana mode, you should get @"あああ" and {3, 0}.
Then, hitting the left arrow key (most likely) generates @"ああ あ" and {2, 0}.


Note the range passed-in is relative to the marked range.

Aki

I have a custom class which implements the NSTextInput protocol.
In, say, TextEdit, if I start typing a multi-character mark (eg switching to Japanese and typing 'aaa'), then hit the left arrow key, the cursor moves into the marked area.


In my own class, I don't receive a moveLeft: message while the mark is active. The only potentially relevant message is firstRectForCharacterRange: - the supplied range appears to be the cursor offset within the mark, but I'm a little reluctant to (ab) use this as it seems to be completely the wrong message that I'm receiving.

Any suggestions?  What am I missing?

Thanks,
Jon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: NSTextInput, multi-character marks, and the cursor position
      • From: Jonathan del Strother <email@hidden>
References: 
 >NSTextInput, multi-character marks, and the cursor position (From: Jonathan del Strother <email@hidden>)

  • Prev by Date: Using NSApplicationDefined events
  • Next by Date: interactive command line apps
  • Previous by thread: NSTextInput, multi-character marks, and the cursor position
  • Next by thread: Re: NSTextInput, multi-character marks, and the cursor position
  • Index(es):
    • Date
    • Thread