Re: NSTextInput, multi-character marks, and the cursor position
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