kinput2 - kanji input server for X11
Kinput2 is an X window application to input Japanese text.
It acts as a front-end for other applications that want kana-kanji
conversion.
When invoked, after some initialization (which will take about a
few to 30 seconds depending on your machine) kinput2 waits quietly
for a Japanese text input request from another client (i.e. no windows
appear). When kinput2 receives a request, it pops up a window and
starts conversion process. It sends the converted text back to the client
when the text is fixed.
Kinput2 has some big improvements over its predecessor,
kinput, which was contributed to X11R4.
- Over-the-spot/On-the-spot
Input
- These features enable conversion process to be done at cursor position,
avoiding unnecessary movement of eyes between cursor position and
conversion window. Kinput2 also supports root window style input
and off-the-spot style input.
- Multiple Protocol
Support
- Kinput2 supports several conversion protocols between front-end and
client. Supported protocols are:
kinput protocol
kinput2 protocol
Matsushita jinput protocol
Sony xlc protocol
XIMP protocol
X Input Method Protocol (X Consortium standard)
- Multiple
Conversion Engine Support
- Kinput2 can use 4 different conversion engines, Wnn, Canna, Sj3 and
Atok. You can choose one at compilation time, or at run time.
- Kinput
Compatibility
- Kinput2 is fully upward-compatible with kinput, so applications
which use kinput as the front-end can also use kinput2. In this
case, the applications cannot take advantage of over-the-spot conversion,
though.
kinput2 accepts all of the standard X Toolkit command line
options. The following options are accepted as well.
- -wnn
- This option specifies that Wnn jserver is used as the conversion
engine.
- -jserver
- This option specifies the hostname of the jserver to be used for
conversion.
- -ccdef
- This option specifies the input character conversion rule file.
- -wnnenvrc4
- This option specifies the Wnn convertion environment initialization file
(wnnenvrc) for Wnn version 4.
- -wnnenvrc6
- This option is similar to -wnenvrc4, but for Wnn version 6.
- -canna
- This option specifies that Canna conversion server (irohaserver) is used
as the conversion engine.
- -cannaserver
- This option specifies the hostname of Canna conversion server.
- -cannafile
- This option specifies Canna conversion customization file.
- -sj3
- This option specifies that Sj3 conversion server (sj3serv) is used as the
conversion engine.
- -sj3serv
- This option specifies the hostname of the primary sj3 conversion
server.
- -sj3serv2
- This option specifies the hostname of the secondary sj3 server. The
secondary server is used when kinput2 cannot connect to the primary
server.
- -atok
- This option specifies that Atok server is used as the conversion
engine.
- -atokserver
- This option specifies the hostname of the atok server to be used for
conversion.
- -font
ascii-font
- This option specifies the default font to be used for displaying ASCII
text.
- -kanjifont
kanji-font
- This option specifies the default font to be used for displaying Kanji
text.
- -kanafont
kana-font
- This option specifies the default font to be used for displaying Kana
text.
- -/+kinput
- This option enables/disables use of kinput protocol family (i.e. kinput
protocol, kinput2 protocol, jinput protocol and xlc protocol).
- -/+ximp
- This option enables/disables use of XIMP protocol.
- -/+xim
- This option enables/disables use of X Input Method Protocol.
- -bc
- Kinput protocol, which is one of the communication protocols
kinput2 supports, uses X window's selection mechanism to notify
other clients of front-end's existence. This option forces kinput2
to use selection ``JAPANESE_CONVERSION'' (which is not a standard
selection name) as well as ``_JAPANESE_CONVERSION''. This is for backward
compatibility, since many of the applications that connect with kinput
still use this non-standard selection.
- -tbheightP
title-bar-height
- This option specifies the height (in pixels) of the titlebar attached to
popup shells such as candidate selection window. Kinput2 uses this
value to compute the correct popup location of these windows.
Below is the widget hierarchy of kinput2.
Kinput2 kinput2
ConversionManager convmanager
KinputProtocol kinputprotocol
XimpProtocol ximpprotocol
IMProtocol improtocol
SeparateConversion converter
CcWnn inputObj
Canna inputObj
Sj3 inputObj
JpWcharDisplay displayObj
Form form
ICLabel mode
JpWcharDisplay display
Canvas text
TransientShell selectionShell
CandidatePanel selection
JpWcharDisplay display
TransientShell auxShell
AuxPanel aux
JpWcharDisplay display
OffTheSpotConversion converter
CcWnn inputObj
Canna inputObj
Sj3 inputObj
JpWcharDisplay displayObj
AdoptedShell modeShell
ICLabel mode
JpWcharDisplay display
CanvasShell text
TransientShell selectionShell
CandidatePanel selection
JpWcharDisplay display
TransientShell auxShell
AuxPanel aux
JpWcharDisplay display
OverTheSpotConversion converter
CcWnn inputObj
Canna inputObj
Sj3 inputObj
JpWcharDisplay displayObj
TransientShell selectionShell
CandidatePanel selection
JpWcharDisplay display
TransientShell auxShell
AuxPanel aux
JpWcharDisplay display
AdoptedShell modeShell
ICLabel mode
JpWcharDisplay display
TransientShell modeShell
ICLabel mode
JpWcharDisplay display
CanvasShell text
There are too many resources to describe here, but you don't have
to know most of them. So here is a brief description of resources which you
might want to set.
Kinput2 application resource:
- conversionEngine
- This resource specifies which conversion engine to use. You can specify
one of ``wnn'', ``canna'', ``sj3'' or ``atok''.
ConversionControl widget (which is a superclass of
SeparateConversion, OffTheSpotConversion and OverTheSpotConversion)
resource:
- sendbackKeyPress
- If this resource is ``true'', the KeyPress events intercepted but unused
by kinput2 are sent back to the client when there is no conversion
text. Although this feature is convenient, it might confuse some clients
since none of corresponding KeyRelease events are sent. Also, since the
``send_event'' flag of those events are true, some clients do not accept
events sent back by kinput2. For example, kterm doesn't accept
those events without specifying
KTerm*allowSendEvents: true
in a resource file.
The default of sendbackKeyPress resource is true.
- titlebarHeight
- This resource specifies the height of a title bar which is attached to
various popup shell windows, such as candicate selection. When computing
the location of these windows, kinput2 uses this value to pop up
them at correct position.
The default is 0P.
OverTheSpotConversion widget resources:
- shrinkWindow
- If this resource is ``true'', the width of on-the-spot conversion window
shrinks according to the length of the text on it. Otherwise, the window
never shrinks. If the performance of Xserver on window resizing is poor,
you may consider setting this resources to false. The default is
true.
- modeLocation
- This resource specifies the location of status widget in case of
over-the-spot type conversion. Unless client specifies the location
explicitly, the location of the status widget is determined by this
resource. If the value of this resource is ``topleft'', the widget is
placed at the top left of the client window. You can also specify
``topright'', ``bottomleft'' and ``bottomright''. If the value is
``tracktext'', the widget is placed just under the cursor position, and
moves according to the cursor. However, if the region available for
conversion is too small, status is placed at the bottom left of the client
area. If the value is ``none'', the status widget will never appear.
The default is ``tracktext''.
- modeBorderForeground
- If this resource is ``true'', the color of status widget is forced to be
same as the foreground color of the widget.
The default is false.
- useOverrideShellForMode
- If this resource is ``true'', the status widget becomes an instance of
OverriddeShell, instead of the default TransientShell. Turn this resource
on if you encounter a strange phenomenon that the status widget keeps
flickering and you cannnot enter any text. This is caused by (incorrect)
focus management of your window manager, and setting this resource will
stop any window management for the widget. The result is that the widget
will be totally ignored by the window manager, meaning you cannot move,
resize, raise nor lower the widget.
The default is false.
OnTheSpotConversion widget resources:
- feedbackAttributes
- This resource specifies the display attributes of preedit string when
on-the-spot input style is used. In on-the-spot style, it is a client's
responsibility to draw preedit string, and kinput2 sends some hints on how
it should be drawn, which is controled by this resource. The value of this
resource should be a comma-separated list of 4 elements, and each element
represents the drawing hint of specific type of string. They represent the
hints for not-yet-converted string, for converted string, for converted
string which belongs to the current clause, for converted string belonging
to the current sub-clause, in that order. Each element consists of zero or
more drawing attributes, which are `R' (reverse), `U' (underline), `H'
(highlight), `P' (primary), `S' (secondary) or `T' (tertiary). You should
consult the Xlib document for the meaning of these attributes (see the
section about preedit draw callback). The default is ``U,,R,H'', which is
close to the drawing attributes used by other input styles.
CcWnn (conversion widget using Wnn) resources:
- jserver
- This resource specifies the hostname of the (primary) jserver to be used
for conversion. If not specified, value of environment variable
``JSERVER'' is used.
- jserver2nd
- This resource specifies the hostname of the secondary jserver, which is
used if the primary server is down. If not specified, kinput2
doesn't use secondary server.
- wnnEnvrc4
- This resource specifies the filename of the Wnn conversion environment
initialization file. This file is used when the Wnn server (jserver) is
version 4. See documents of Wnn for the format of the file. The default is
/usr/local/lib/wnn/wnnenvrc.
- wnnEnvrc6
- This resource also specifies the filename of the Wnn conversion
environment initialization file. This file is used when the Wnn server
(jserver) is version 6. See documents of Wnn for the format of the
file.
- wnnEnvrc
- This resource is provided for backward compatibility. Use wnnEnvrc4
or wnnEnvrc6 instead.
- ccdef
- This resource specifies the input character conversion rule file. The
default is /usr/lib/X11/ccdef/ccdef.kinput2.
Canna (conversion widget using Canna) resources:
- cannahost
- This resource specifies the hostname of the canna server to be used.
- cannafile
- This resource specifies Canna conversion customization file.
Sj3 (conversion widget using SJ3) resources:
- sj3serv
- This resource specifies the hostname of the (primary) sj3serv to be used
for conversion. If not specified, value of environment variable
``SJ3SERV'' is used.
- sj3serv2
- This resource specifies the hostname of the secondary sj3serv, which is
used if the primary server is down.
- rcfile
- This resource specifies the filename of the Sj3 conversion customization
file. The default is /usr/lib/X11/sj3def/sjrc.
- rkfile
- This resource specifies the Romaji-Kana conversion rule file. The default
is /usr/lib/X11/sj3def/sjrk.
Atok (conversion widget using Atok) resources:
- server
- This resource specifies the hostname of the atok server to be used for
conversion.
- port
- This resource specifies the port number of the atok server.
- conf
- This resource specifies the name of atok configuration file.
- style
- This resource specifies the name of atok style file.
JpWcharDisplay (widget for drawing Japanese text)
resources:
- font,
kanjiFont, kanaFont
- These resource specifies the font to be used for displaying ASCII, Kanji
and Kana text, respectively. Since kinput2 changes fonts
dynamically by client requests, the fonts specified by these resources
might not be used. If not specified, the following fonts are used.
-*-fixed-medium-r-normal--14-*-*-*-c-*-iso8859-1
-*-fixed-medium-r-normal--14-*-*-*-c-*-jisx0208.1983-0
-*-fixed-medium-r-normal--14-*-*-*-c-*-jisx0201.1976-0
KinputProtocol (widget for handling kinput protocol family
- kinput, kinput2, jinput and xlc protocol) resources:
- backwardCompatible
- All of the protocols in kinput protocol family use X window's selection
mechanism to notify other clients of front-end's existence. If this
resource is ``true'', kinput2 uses selection
``JAPANESE_CONVERSION'' (which is not a standard selection name) as well
as ``_JAPANESE_CONVERSION''. This is for backward compatibility, since
many of the applications using these protocols still use this non-standard
selection.
The default is true.
- xlcConversionStartKey
- This resource specifies the key that starts the conversion. The key is a
hint for the clients using xlc protocol to determine when they should
request conversion to kinput2. The syntax of the specification is a
subset of the translation table syntax:
modifier-names<Key>keysym-name
where modifier-names is a combination of Shift, Lock,
Meta, Alt and Mod[1-5].
The default is Shift<Key>space.
XimpProtocol and IMProtocol (which handle XIMP
protocol and X Input Method Protocol) resources:
- conversionStartKeys
- This resource specifies the keys that start the conversion. The syntax of
the specification is a subset of the translation table syntax:
modifier-names<Key>keysym-name
where modifier-names is a combination of Ctrl, Shift,
Lock, Meta, Alt and Mod[1-5]. A '~' can
precede each modifier name, meaning the modifier must not be asserted. For
example, if the conversion start key is ``Kanji'' key with shift key
pressed and control key not pressed (other modifier keys may be pressed or
not), the specification is:
Shift ~Ctrl<Key>Kanji
Multiple keys can be specified by separating them with newlines.
The default is as follows:
Shift<Key>space \n\
Ctrl<Key>Kanji
- defaultFontList
- This resource specifies the default fonts to be used if the client does
not specify fonts to be used. The default is
-*-fixed-medium-r-normal--14-*-*-*-c-*.
When using X Input Method Protocol, you have to specify the name
of the input server you want to use. This can be done by setting
``inputMethod'' resource or setting XMODIFIERS environment
variable. Since some clients don't regard inputMethod resource while other
clients ignore XMODIFIERS variable, so it is a good idea to set both of
them.
To use kinput2, you should add the following line to your resource
file (such as .Xresources or .Xdefaults):
*inputMethod: kinput2
and, set XMODIFIERS to ``@im=kinput2''.
setenv XMODIFIERS "@im=kinput2" (for csh)
XMODIFIERS="@im=kinput2"; export XMODIFIERS (for sh)
Wnn documents, Canna documents, Sj3 documents, XIMP protocol
specification, The Input Method Protocol
Copyright 1988, 1989, 1990, 1991, 1992, 1994 Software Research Associates, Inc.
Copyright 1991 NEC Corporation, Tokyo, Japan.
Copyright 1991 Sony Corporation
Copyright 1998 MORIBE, Hideyuki
Copyright 1999 Kazuki YASUMATSU
Copyright 1999 Justsystem Corporation, Japan.
Makoto Ishisone, Software Research Associates, Inc.
Akira Kon, NEC Corporation
Naoshi Suzuki, Sony Corporation
MORIBE, Hideyuki
Kazuki YASUMATSU
Atsushi Irisawa