Mailing List Archive

Support open source code!


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

[tlug] Re: debian japanese



Michael Moyle <michael@example.com> writes:

> I found editinng .Xresources gave me some control. I would like to know
> where kinput is documented because not all of the directes are in the
> man page. 
>
> #define XIM kinput2
> !Kinput2*conversionStartKeys: Shift<Key>space \n\
> !       Ctrl<Key>o \n\
> !       Ctrl<Key>backslash \n\
> !       Alt<Key>Zenkaku_Hankaku
> !Kinput2*conversionStartKeys: Shift<Key>space
> Kinput2*conversionStartKeys: Ctrl<Key>space
> !skkinput*conversionStartKey: Shift<Key>space
> !skkinput*conversionStartKey: Ctrl<Key>space
>
>
> ^^ for some reason redefining Shift-space to Ctrl-space removed the
> shift-space default. That could use further experiementation. I tried to
> simply comment out shift-space, but I think I had to redefine space
> which doesn't make much sense to me. 

If you just comment it out, kinput2 will still read it's global
app-defaults file (/usr/X11R6/lib/X11/app-defaults/Kinput2)
which usually defines the Shift-Space keybinding. That's
the reason why you have to override it in your ~/.Xresources
with something else to get an effect.

As I use (X)Emacs, Ctrl<Key>space is a bad key-binding in my opinion,
because "C-SPC" is `set-mark-command' in (X)Emacs and most (X)Emacs
users use this command is very often.

> KTerm*VT100.Translations: #override\
>         Ctrl<Key>o: begin-conversion(_JAPANESE_CONVERSION)\n\
> !       ~Meta <Key>BackSpace: string("\177")\n\
> !       <Key>Delete: string("\033[3~")\n\
> !       <Key>Home: string("\033OH")\n\
> !       <Key>End: string("\033OF")
>
>
> This got Ctrl-o to work. I tried getting Ctrl-space to work. I got it to
> start kinput, but ctrl-space would not stop it. Ctrl-o works find "for
> some reason". 

Because Ctrl-o is the the default binding for Canna to switch
back to alpha-mode. To change this, do the following:

    cp /var/lib/canna/sample/default.canna ~/.canna

then append  the following lines to ~/.canna:

    ; avoid that C-o is used to start and stop XIM
    ; (this is bad because if C-o starts XIM, it can't be used
    ; for 'extend in the native XEmacs-Canna interface, because
    ; it starts XIM instead of doing 'extend.

    (global-unbind-key-function 'japanese-mode)
    (global-unbind-key-function 'alpha-mode)
    ; use F4 instead:
    ;(set-key 'alpha-mode "\F4" 'japanese-mode)
    ;(set-key 'empty-mode "\F4" 'alpha-mode)
    ; use C-space instead
    (set-key 'alpha-mode "\C- " 'japanese-mode)
    (set-key 'empty-mode "\C- " 'alpha-mode)
    ; use the default, C-o
    ;(set-key 'alpha-mode "\C-o" 'japanese-mode)
    ;(set-key 'empty-mode "\C-o" 'alpha-mode)

and restart kinput2. See also
http://www.suse.de/~mfabian/suse-cjk/xemacs-xim-canna-conflict.html

Now you can use 

KTerm*VT100.Translations: #override\
        Ctrl<Key>space: begin-conversion(_JAPANESE_CONVERSION)\n\
!       ~Meta <Key>BackSpace: string("\177")\n\
!       <Key>Delete: string("\033[3~")\n\
!       <Key>Home: string("\033OH")\n\
!       <Key>End: string("\033OF")

and you will be able to use Ctrl-space to enter *and* leave
Japanese input.

From your description your are using kterm without the option '-xim'
i.e. you are using kterm with the kinput protocol. The above way of
setting of Ctrl<Key>space is only effective when kinput protocol is
used. 

If you use 'kterm -xim' kterm will use XIM protocol and the behaviour
of kterm will be subtly different again, because now only the
settings from ~/.canna and /usr/X11R6/lib/X11/app-defaults/Kinput2
will be effective.

But with the above setup in ~/.canna, you will be able to use
Control-Space to enter and leave Japanese mode also when using XIM
instead of kinput protocol.

kterm is a bit weird.

> It would be nice to understand these things better for a web page. I'm
> afraid my page would be full of statements, like "this seemed to work",
> apply this hack with xmodmap, no idea what this does, install a pile of
> fonts into you can see kanji ;)

-- 
Mike Fabian   <mfabian@example.com>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links