Mailing List Archive

Support open source code!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Re: Correction: Re: epcEditor

Jim Breen <> writes:

> A correction below:
> [Jim Breen (Re: [tlug] Re: epcEditor) writes:]
>>> OK, how do I do Japanese input in Tcl/Tk. Here is a little test program:
>>> 	tk useinputmethods 1
>>> 	set ntext " 日本語 (にほんご)"
>>> 	label .jpl -text $ntext
>>> 	button .jp -text $ntext
>>> 	entry .jpe -textvariable ntext
>>> 	entry .jpx -textvariable text
>>> 	pack .jpl .jp .jpe .jpx
>>> I have cannaserver running, and kinput2 running with the "-xim" option.
>>> I lunch a fresh kterm with the "-xim" option and with XMODIFIERS set to
>>> "". I set LC_CTYPE to ja_JP.
>>> I launch wish with that tcl script. A box with the four lines 
>>> correctly displaying the Japanese appears.
>>> How to I type Japanese into the text box? The usual Ctrl-space or
>                                                        XXXXXXXXXX
>>> Ctrl-\ sequences do nothing. I can't even paste into it.
> I meant "Shift-space".
> According to the
> app-defaults file is /usr/X11R6/lib/X11/app-defaults/Kinput2 and it
> says:
> *XimpProtocol.ForceDefaultServer: true
> ! X Input Method Protocol
> *IMProtocol.locales: ja_JP.SJIS, ja_JP.EUC, ja_JP, japanese, japan, ja
> ! common to XimpProtocol and IMProtocol
> *defaultFontList: -misc-fixed-medium-r-normal--14-*-*-*-c-*
> *ConversionStartKeys: Shift<Key>space

This works for me in SuSE Linux 8.0-beta. See the screen shot at

As you can see, this uses root window input style, i.e. when typing
Shift-Space, an 'Kana-Kanji Conversion' window pops up where you can
type Japanese. Each time you confirm a kana->kanji conversion with
'Return' the result appears in the tk-widget. Typing Shift-Space again
closes the 'Kana-Kanji Conversion' window again.

Until very recently, XIM didn't work at all in the upstream version of
tcl/Tk 8.3.4.

Keiichi Takahashi <>, Reinhard Max <>,
Jeffrey Hobbs <> and me fixed this recently in the
upstream tcl/Tk sources. Only a small fix was necessary to make it
work with 'root window' style input.  This is a bit ugly, but usable
and better than nothing. To support the more convenient 'OverTheSpot'
or 'OnTheSpot' input styles, more work is necessary.

Mike Fabian   <>

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links