• 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: Inserting localized text to NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inserting localized text to NSTextView


  • Subject: Re: Inserting localized text to NSTextView
  • From: John Stiles <email@hidden>
  • Date: Wed, 18 Apr 2007 13:42:02 -0700

No idea. I don't know an API to do this. I suppose if you forced your input method to be the same as the input method of the app you're logging (not sure how you'd do this), and then manually synthesized keystrokes matching what the user typed (see CGPostKeyboardEvent), it might work.

On Apr 18, 2007, at 12:00 PM, email@hidden wrote:

That makes sense for double-byte (?) languages such as Japanese, but what about languages that don't use a cheatsheet window or are not interactive? If I can have it work only for Eurporean languages, I'd be happy.
Thanks.



On Wednesday, April 18, 2007, at 11:42AM, "John Stiles" <email@hidden> wrote:
AFAICS there isn't a good way to turn keystrokes from an event tap into
the actual text typed.
The issue here is that most some input methods are
graphical/interactive, e.g. they can pop up a cheatsheet of alternatives
and the user selects from the list by either typing or clicking. So you
might see the following events


keystroke n
keystroke i
keystroke h
keystroke o
keystroke n
keystroke n
keystroke g
keystroke o
keystroke space <-- at this point a cheatsheet window appears on top of
the NSTextView
mouse click on the cheatsheet window


And all those events turn into three characters, ???. I don't see a good
way to get from point A to point B.



email@hidden wrote:

I am using an event tap function for my app. Whatever the user types, I insert onto a text view. If, for example, the user types 'a' onto a TextEdit window when using Hebrew, a Hebrew representation of 'a' appears on the TextEdit window. My tap function gets the 'a' and inserts it onto its own text view. However, it doesn't insert the Hebrew representation, instead it inserts 'a'. I'd like to have my app insert the Hebrew representation of 'a'' onto its text view also. But I don't know how to do it. Thanks!


On Wednesday, April 18, 2007, at 11:24AM, "John Stiles" <email@hidden> wrote:



This is more complicated than you think? have you ever looked at the
Japanese and Chinese input types?
You can simulate keyboard presses at a very low level if necessary,
but are you 100% sure that this is what you want? What is your app
doing exactly?



On Apr 18, 2007, at 11:17 AM, email@hidden wrote:



I have an app with a NSTextView. If, for example, the user selects
Hebrew in the system preference International panel Input Menu,
typing abcd onto the text view produces Hebrew. However, if I
programatically insert abcd using [textView insertText:@"abcd"]
then English, not Hebrew appears in the text view. How can I
programatically insert text onto a text view so that it appears
just as the user typed the text? Thanks.
_______________________________________________









_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >Inserting localized text to NSTextView (From: email@hidden)
 >Re: Inserting localized text to NSTextView (From: John Stiles <email@hidden>)
 >Re: Inserting localized text to NSTextView (From: email@hidden)
 >Re: Inserting localized text to NSTextView (From: John Stiles <email@hidden>)
 >Re: Inserting localized text to NSTextView (From: email@hidden)

  • Prev by Date: [Cocoa] Design Question for an NSMenu subclass
  • Next by Date: guilty for asking questions?
  • Previous by thread: Re: Inserting localized text to NSTextView
  • Next by thread: Re: Inserting localized text to NSTextView
  • Index(es):
    • Date
    • Thread