• 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: 2 more NSTextInput marking questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2 more NSTextInput marking questions


  • Subject: Re: 2 more NSTextInput marking questions
  • From: Aki Inoue <email@hidden>
  • Date: Tue, 27 Sep 2005 12:52:55 -0700

Jon,

First off - I'm having trouble dealing with mouse clicks in marked areas. I need to update the cursor position within the marked area, so call NSInputManager's markedTextSelectionChanged: method, giving it the new cursor location. It totally ignores me, and any future additions to the mark continue to be appended to the end of the mark, rather than where the cursor ought to be.
Before handling mouse events by yourself and notify the input system via -markedTextSelectionChanged:client:, you need to let the system to have a chance at the event (after all the marked area is conceptually own by the system).

First, check to see the return value from -wantsToHandleMouseEvents. If it returns YES, try sending -handleMouseEvent:. The method returns YES if the system swallowed the event, in that case, you ignore the event and continue processing the next.

If either method returns NO, then, you can handle the mouse event yourself and notify the system via -markedTextSelectionChanged:client:.

Secondly, if you go into TextEdit and start typing a mark, then hit escape, the mark is abandoned. If I hit escape during a mark input, I don't get a message telling me to unmark the mark, nor do I get a message telling me that escape has been hit. So there appears to be no way of dealing with this in the same way as, for instance, TextEdit. What am I missing?
Apple-made input methods clear the marked text via sending 0-length text. You should be getting @"" with your - setMarkedText:selectedRange:.

Aki
_______________________________________________
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


References: 
 >2 more NSTextInput marking questions (From: Jonathan del Strother <email@hidden>)

  • Prev by Date: Re: Clear bitmap...
  • Next by Date: Re: sync quicktime playback over multiple computers
  • Previous by thread: 2 more NSTextInput marking questions
  • Next by thread: NSManagedObject and dealloc
  • Index(es):
    • Date
    • Thread