Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to tell current input mode




On Mar 24, 2007, at 11:59 AM, Edward de Jong wrote:

In the menu bar there is a kind of an input mode selector, where you pick "arabic", "arabic qwerty", "hawaiian", and I want to get this region code or whatever the number is that corresponds to each of the input methods, so that my program can turn text entry right to left when Hebrew is selected. But none of the simple calls in the script manager seem to return this number. The keyboard script typically stays at value 126 (unicode), and I need to distinguish between hebrew and other input languages. I will probably do a font switch for the user as well.

This is not my area of expertise, but I think you're going about it the wrong way:


- The old-style scripts and region codes do not support all languages.

- The approach you're wanting to use requires the application to know more about languages than it really should.

- I assume Arabic, for example, allows people to type at least some non-Arabic text, such as Roman digits. You need to chose direction based on the characters, not the input method.

Each Unicode character has a direction associated with it in the Unicode standard. If you use that instead of relying on knowledge about specific languages your application will work with all languages Mac OS X supports now and in the future. I don't know the APIs for this stuff, but I know they exist.

You have to use a different mechanism to determine the best font to use, but again, basing it on a language or script is probably not the best option. As I said, this is not my area of expertise. However, by telling us what you really want to accomplish you have the best chance of getting the best advice.

Larry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >RE: how to tell current input mode (From: Edward de Jong <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.