Mailing List Archive

Support open source code!


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

Re: XIM, kinput2 & Tk



>>>>> "Jim" == Jim Breen <jwb@example.com> writes:

    Jim> I was referring to the TK documentation, which has a
    Jim> one-liner saying that you set "tk useinputmethods 1" to
    Jim> engage XIM. It doesn't even say which keystrokes turn it on,
    Jim> which is application-specific.

Exactly.  Tk has no idea how it is done.  The XIM model is that
Kinput2 makes all the decisions about what to do with keystrokes,
including the initiation sequence.  TheRe's no reason why Kinput2,
xwnmo, et al need to use the same sequence, and (this being Eunuchs)
they probably don't.  And of course the user or sysadmin can configure
it to something else again.

I believe the delegation of control of the keyboard to the IM is also
true for Mac and Windows, but presumably The Kanji Key wins there
"Because Bill-sama Says So."

    Jim> What if a user wants to run an app that switches between a
    Jim> Korean IM and a German one? Locales can't be changed on the
    Jim> fly

Sure they can, even if Chris says not.  See Chapter 28 of Professional
Linux Programming, Wrox 2000, for some sample code (tested!) that
shows how to do it (on page 1k, as it happens, cool)!  I've never seen
it implemented anywhere else, but Uli Drepper threatened us with a
glibc 2.2 with _threadsafe_ multiple locales per program when he was
here in January 1999.  Dunno if he carried out his threat.  Seems
silly, since noone would actually use it....

And Chris is correct, you can only use the current locale in XOpenIM,
but there's no reason why you can't open multiple IMs, including
simultaneously, after changing the program's locale.

Nobody does this (not even me, yet, but XEmacs 22.0 _may_ get
it---it's a trivial extension to lazy initting of XIM, which is
something I've wanted for years).  But that's because programmers are
normally incapable of using _any_ natural language correctly, so they
cannot imagine wanting to use two or more at once.  ;-)

    >>> In your case, you need (a) XMODIFIERS="@example.com=kinput2"

    Jim> Got that.

Cool.

    >>> and (b) LANG="ja_JP.eucJP" (probably, works for me but YYMV)
    >>> in your environment or you will lose.  Of course, you may lose
    >>> anyway; this is XIM.

    Jim> Doesn't work. Possibly because LC_ALL contains "C", according
    Jim> to the return from setlocale().

OK, well you can try invoking your "tkApp" (more forcibly) with
"LC_ALL=ja_JP.eucJP tkApp".


-- 
University of Tsukuba                Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Institute of Policy and Planning Sciences       Tel/fax: +81 (298) 53-5091
_________________  _________________  _________________  _________________
What are those straight lines for?  "XEmacs rules."


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links