Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » IME Input Mode
IME Input Mode [message #452241] Tue, 15 March 2005 15:21 Go to next message
Neil Goldsmith is currently offline Neil GoldsmithFriend
Messages: 68
Registered: July 2009
Member
We want to enable the user to enter far east Character sets into our SWT
based editor. Getting the shell of the IEditorSite, we can set the type of
input mode like this:
site.getShell().setImeInputMode(SWT.DBCS);

However, when I stepped into this call, it basically does nothing for
locales that are not Double Byte:

public void setImeInputMode (int mode) {
checkWidget ();
if (!OS.IsDBLocale) return;
....

I don't follow why it does this. I have a global IME Input bar on my desktop
that allows me to enter various characters from different character sets,
even though my locale is not DB. Why would the code limit setting the IME
input mode to just DB locales? Also, considering you could enter other
modes here: ALPHA, NATIVE, ROMAN, etc.

Next I attempted to change my default locale via the control panel (in
Windows XP Pro) to a far east language, which worked fine, but it still did
not consider it a DB locale (I tried Korean, Japanese and Chinese), even
though when I queried programatically for the default Locale it showed the
change as expected. Would I have to have one of the far east OS's installed
for it to work?

Finally (yes, alot of questions ), In our program we create alot of
different editors. Is there any where we can set the IME Input mode to DBCS
just once and have them all inherit that attribute? Is this call even
necessary? I am able to enter far east chars in my editor even though the
call to setImeInputMode essentially does nothing (what is it used for then?)

Thanks!


  • Attachment: biggrin.gif
    (Size: 0.15KB, Downloaded 124 times)
Re: IME Input Mode [message #452248 is a reply to message #452241] Tue, 15 March 2005 18:58 Go to previous messageGo to next message
Felipe Heidrich is currently offline Felipe HeidrichFriend
Messages: 29
Registered: July 2009
Junior Member
Hi,
I'll try to give you some answers.

1. You don't need to call setImeInputMode(SWT.DBCS) to enable IME in your
app. People usually set the input mode in the IM itself (the little applet
near to the clock in your desktop). In SWT, all you need is a Canvas with
a Caret and a key listener.

2. SWT support for DBCS is only supposed to work in real DBCS machines, a
English Windows XP with Korean enabled is not a real DBCS machine.
Basically the test "if (!OS.IsDBLocale) return" is to prevent the DBCS
code from running on locales where it isn't required (mostly for
performance reasons).

3. Windows creates an input method context for its windows, that is why
you have something working. But if you test a little better you'll see it
doesn't work correctly (because SWT doesn't configure it on non-DBCS
locales. The font, colors, geometry, etc, are wrong).

If you really need to test for CJK input on your machine you can hack SWT
code to force the flag OS.IsDBLocale to be true.


Felipe

Neil Goldsmith wrote:

> We want to enable the user to enter far east Character sets into our SWT
> based editor. Getting the shell of the IEditorSite, we can set the type of
> input mode like this:
> site.getShell().setImeInputMode(SWT.DBCS);

> However, when I stepped into this call, it basically does nothing for
> locales that are not Double Byte:

> public void setImeInputMode (int mode) {
> checkWidget ();
> if (!OS.IsDBLocale) return;
> ....

> I don't follow why it does this. I have a global IME Input bar on my desktop
> that allows me to enter various characters from different character sets,
> even though my locale is not DB. Why would the code limit setting the IME
> input mode to just DB locales? Also, considering you could enter other
> modes here: ALPHA, NATIVE, ROMAN, etc.

> Next I attempted to change my default locale via the control panel (in
> Windows XP Pro) to a far east language, which worked fine, but it still did
> not consider it a DB locale (I tried Korean, Japanese and Chinese), even
> though when I queried programatically for the default Locale it showed the
> change as expected. Would I have to have one of the far east OS's installed
> for it to work?

> Finally (yes, alot of questions ), In our program we create alot of
> different editors. Is there any where we can set the IME Input mode to DBCS
> just once and have them all inherit that attribute? Is this call even
> necessary? I am able to enter far east chars in my editor even though the
> call to setImeInputMode essentially does nothing (what is it used for then?)

> Thanks!


> begin 666 biggrin.gif
> M1TE&.#EA#P`/`*(``/___[V]O5G_R&.$_P```````````````"'Y! D```$`
> M+ `````/```0 A=``,(%$B@8,&!! 40``!@(4.'!!0&B!A1H46+! 96-%A0
> M@$2-'D.*S#A1(<>3%$LN=-BPX4>$)Q'"K!CR($B3-3>6%,DSI*'#%NZ[ @Q
> 1*$2)&UEV?#F1ID>;`0("`#L`
> `
> end
Re: IME Input Mode [message #452269 is a reply to message #452248] Wed, 16 March 2005 15:22 Go to previous messageGo to next message
Neil Goldsmith is currently offline Neil GoldsmithFriend
Messages: 68
Registered: July 2009
Member
Great information! Thanks

1. You mention the little IM applet near the clock. I don't have an applet
like that by default (XP Pro). I did download and install the Global IM
which by default lives on the top bar of all my windows (always on top). Is
this the same thing? I only installed this so I could enter East Asian
characters. Would users need to install it too?

3. Should I expect that users can use my SWT editor to enter East Asian
characters without having to change anything codewise? Is the default input
method that Windows creates generally usable even with the deficiencies you
stated?



"Felipe" <Felipe_Heidrich@ca.ibm.com> wrote in message
news:d17b8r$u63$1@www.eclipse.org...
> Hi,
> I'll try to give you some answers.
>
> 1. You don't need to call setImeInputMode(SWT.DBCS) to enable IME in your
> app. People usually set the input mode in the IM itself (the little applet
> near to the clock in your desktop). In SWT, all you need is a Canvas with
> a Caret and a key listener.
>
> 2. SWT support for DBCS is only supposed to work in real DBCS machines, a
> English Windows XP with Korean enabled is not a real DBCS machine.
> Basically the test "if (!OS.IsDBLocale) return" is to prevent the DBCS
> code from running on locales where it isn't required (mostly for
> performance reasons).
>
> 3. Windows creates an input method context for its windows, that is why
> you have something working. But if you test a little better you'll see it
> doesn't work correctly (because SWT doesn't configure it on non-DBCS
> locales. The font, colors, geometry, etc, are wrong).
>
> If you really need to test for CJK input on your machine you can hack SWT
> code to force the flag OS.IsDBLocale to be true.
>
>
> Felipe
>
> Neil Goldsmith wrote:
>
>> We want to enable the user to enter far east Character sets into our SWT
>> based editor. Getting the shell of the IEditorSite, we can set the type
>> of input mode like this:
>> site.getShell().setImeInputMode(SWT.DBCS);
>
>> However, when I stepped into this call, it basically does nothing for
>> locales that are not Double Byte:
>
>> public void setImeInputMode (int mode) {
>> checkWidget ();
>> if (!OS.IsDBLocale) return;
>> ....
>
>> I don't follow why it does this. I have a global IME Input bar on my
>> desktop that allows me to enter various characters from different
>> character sets, even though my locale is not DB. Why would the code limit
>> setting the IME input mode to just DB locales? Also, considering you
>> could enter other modes here: ALPHA, NATIVE, ROMAN, etc.
>
>> Next I attempted to change my default locale via the control panel (in
>> Windows XP Pro) to a far east language, which worked fine, but it still
>> did not consider it a DB locale (I tried Korean, Japanese and Chinese),
>> even though when I queried programatically for the default Locale it
>> showed the change as expected. Would I have to have one of the far east
>> OS's installed for it to work?
>
>> Finally (yes, alot of questions ), In our program we create alot of
>> different editors. Is there any where we can set the IME Input mode to
>> DBCS just once and have them all inherit that attribute? Is this call
>> even necessary? I am able to enter far east chars in my editor even
>> though the call to setImeInputMode essentially does nothing (what is it
>> used for then?)
>
>> Thanks!
>
>
>> begin 666 biggrin.gif
>> M1TE&.#EA#P`/`*(``/___[V]O5G_R&.$_P```````````````"'Y! D```$`
>> M+ `````/```0 A=``,(%$B@8,&!! 40``!@(4.'!!0&B!A1H46+! 96-%A0
>> M@$2-'D.*S#A1(<>3%$LN=-BPX4>$)Q'"K!CR($B3-3>6%,DSI*'#%NZ[ @Q
>> 1*$2)&UEV?#F1ID>;`0("`#L`
>> `
>> end
>
>
Re: IME Input Mode [message #452573 is a reply to message #452269] Tue, 22 March 2005 18:31 Go to previous message
Felipe Heidrich is currently offline Felipe HeidrichFriend
Messages: 29
Registered: July 2009
Junior Member
1. I never tested Global IM. But I guess it should be equivalent.

>3. Should I expect that users can use my SWT editor to enter East Asian
>characters without having to change anything codewise?
Yes, as long as they are running on real East Asias machines.

>Is the default input method that Windows creates generally usable even with
>the deficiencies you stated?
Not really.

Sorry for the delay, I don't read the newsgroup often enough.
Felipe
Previous Topic:dialog box -> view ?
Next Topic:serialVersionUID for EventObject
Goto Forum:
  


Current Time: Tue Nov 12 18:46:12 GMT 2019

Powered by FUDForum. Page generated in 0.01789 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top