Re: Multi-keystroke text input issue
Re: Multi-keystroke text input issue
- Subject: Re: Multi-keystroke text input issue
- From: Satoshi Matsumoto <email@hidden>
- Date: Tue, 09 Nov 2004 22:02:29 +0900
Hi Gideon,
on 04.11.9 8:44 PM, Gideon King wrote:
> I have a case where I need to regenerate a text view after each
> keystroke (in textView:shouldChangeTextInRange:replacementString:) and
> reset the text using the text storage's setAttributedString: method.
> This works fine in English, but when users are entering text which
> requires multiple keystrokes for generation of a single character (e.g.
> in using Hirgana input), the call to the shouldChangeTextInRange...
> method is sent for every keystroke even if a full character has not
> been composed yet.
>
> How do I pick up that I don't have a full character yet so I can allow
> the textview to display the partially composed character?
You can check it using NSTextInput protocol
- (BOOL)hasMarkedText
Returns YES if the receiver has marked text, NO if it doesn’t. Unlike other
methods in this protocol, this one is not called by an input server. The
text view itself may call this method to determine whether there currently
is marked text. NSTextView, for example, disables the Edit>Copy menu item
when this method returns YES.
Hope that helps.
Satoshi Matsumoto
_______________________________________________
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