Re: Multilanguage support
Re: Multilanguage support
- Subject: Re: Multilanguage support
- From: email@hidden
- Date: Mon, 7 Jun 2004 15:57:59 +0200
Hi Clark!
thanks for your kindly answer.
I've tried to implement insertText in my application, but I can't get any
string because the code is never reached :(
I'm a newby in Cocoa dev, so let me explain:
I've an object MyApp that inherits from NSApplication.
It has a -(void)sendEvent:(NSEvent*)e
that is used to get events and do some stuff.
Now I've tried to add your
- (void)insertText:(NSString*)insertString
but it is never called, and I don't understand why :(
I saw on the web an example (not completed) that implement the
keyDown handler in this way:
-(void)keyDown:(NSEvent*)theEvent
{
[self interpretKeyEvents:[NSArray arrayWithObjects:e, nil]];
}
but still not work.
Anyone can help me ?
thanks
Max
----- Original Message -----
From: "Clark Cox" <email@hidden>
To: "Massimiliano Mazzeschi@Home" <email@hidden>
Cc: <email@hidden>
Sent: Friday, June 04, 2004 2:38 PM
Subject: Re: Multilanguage support
>
>
On Jun 04, 2004, at 03:09, Massimiliano Mazzeschi@Home wrote:
>
>
> Hi!
>
> I've a Cocoa based application and I'd like to support multilanguage.
>
> I known that the type member of the NSEvent is NSKey for ''normal''
>
> keyboard keys,
>
> and this already work, so I tried to dump what happened when Japanes
>
> keys are
>
> pressed (using the Multilanguage Panel). Not NSKey are issued, but
>
> only
>
> NSSystemDefined. I've checked on the web, but I can't find anything
>
> that can help me to
>
> decode the information.
>
> If I send Japanes to a terminal it shows the UTF-8 codes (base 8)
of
>
> the char.
>
> What I'd like to known in my application is the UTF-8 form of the
>
> char.
>
> Anyone can help me ?
>
> Is there any other way to intercept the multilanguage sequences ?
>
>
Sure, in whichever object is your first responder (i.e. the control or
>
view that is receiving the text input), implement:
>
>
- (void)insertText:(NSString*)insertString;
>
>
The string passed in as the parameter is the result *after* any input
>
methods have parsed the raw key input. For this reason, as you have
>
discovered, it is usually a bad idea to deal with raw key events.
>
>
>
--
>
Clark S. Cox III
>
email@hidden
>
http://homepage.mac.com/clarkcox3/
>
http://homepage.mac.com/clarkcox3/blog/B1196589870/index.html
>
__________________________________________________________________
Tiscali ADSL libera la velocita'!
Attiva Senza Canone entro il 14 giugno: navighi a 1,5 euro l'ora per i primi
3 mesi,se scegli il modem e' tuo in comodato gratuito e in piu' hai gratis
SuperMail per 12 mesi. Non aspettare, attivala subito!
http://abbonati.tiscali.it/adsl/prodotti/640Kbps/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.