KINPUT2(1)
β¨ NAME β¨
kinput2 β kanji input server for X11 π
πΈ SYNOPSIS πΈ
kinput2 [-options...]
π¦ DESCRIPTION π¦
Kinput2 is an X window application for inputting Japanese text, and it's literally the bestie your other apps call when they need kana-kanji conversion. It's a front-end, and it does the heavy lifting so your client apps don't have to. π«Ά
When you invoke it, it does a lil' initialization thing first β that can take about a few to 30 seconds depending on your machine, so don't panic if nothing happens. After that, kinput2 just waits quietly for a Japanese text input request from another client. And by quietly I mean no windows appear at all, bestie, it's just vibing in the background. π When a request finally comes in, it pops up a window and starts the conversion process. Once the text is fixed, it sends the converted text back to the client. That's the whole loop, iconic behavior. β¨
Also?? kinput2 has some big improvements over its predecessor, kinput, which was contributed to X11R4. Glow-up of the century, no cap. π
π₯ Over-the-spot/On-the-spot Input
These features let the conversion process happen right at the cursor position, which means you don't have to ping-pong your eyeballs between the cursor and a conversion window. Your eyes stay comfy, your neck stays unbothered. π Kinput2 also supports root window style input and off-the-spot style input, so whatever your setup, it's got a vibe for you.
π Multiple Protocol Support
Kinput2 speaks several conversion protocols between the front-end and the client, because it's multilingual in the networking sense. π The 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 get to pick one at compilation time, or at run time. Choose your fighter. π
π Kinput Compatibility
Kinput2 is fully upward-compatible with kinput, so any application that uses kinput as the front-end can also use kinput2. Slay, zero migration pain. π¦ But β and here's the catch β in that case, the applications cannot take advantage of over-the-spot conversion. F in the chat for the cursor-adjacent lifestyle. π
β¨ OPTIONS β¨
kinput2 accepts all of the standard X Toolkit command line options. And also, these ones are accepted as well:
-wnnβ says "use the Wnnjserveras the conversion engine, please and thank you." π§-jserverβ tells it the hostname of thejserverto use for conversion.-ccdefβ points at the input character conversion rule file. π-wnnenvrc4β points at the Wnn convertion environment initialization file (wnnenvrc) for Wnn version 4.-wnnenvrc6β same energy as-wnenvrc4, but for Wnn version 6. (The sequel, basically.)-cannaβ says "use the Canna conversion server (irohaserver) as the conversion engine." πΈ-cannaserverβ tells it the hostname of the Canna conversion server.-cannafileβ points at the Canna conversion customization file.-sj3β says "use the Sj3 conversion server (sj3serv) as the conversion engine." β¨-sj3servβ tells it the hostname of the primary sj3 conversion server.-sj3serv2β tells it the hostname of the secondary sj3 server. The secondary one kicks in when kinput2 cannot connect to the primary server β backup bestie behavior. π«Ά-atokβ says "use the Atok server as the conversion engine." π-atokserverβ tells it the hostname of the atok server to use for conversion.-fontascii-font β sets the default font used for displaying ASCII text.-kanjifontkanji-font β sets the default font used for displaying Kanji text.-kanafontkana-font β sets the default font used for displaying Kana text.-/+kinputβ enables/disables use of the kinput protocol family (that's thekinputprotocol,kinput2protocol,jinputprotocol andxlcprotocol).-/+ximpβ enables/disables use of the XIMP protocol.-/+ximβ enables/disables use of the X Input Method Protocol.-bcβ okay so, the kinput protocol (one of the communication protocols kinput2 supports) uses X window's selection mechanism to notify other clients that a front-end exists. This option forces kinput2 to use the selection`JAPANESE_CONVERSION`(which is not a standard selection name, btw) as well as`_JAPANESE_CONVERSION`. It's all for backward compatibility, because a lot of the applications that connect withkinputstill use this non-standard selection. Old apps, we love you anyway. π-tbheightPtitle-bar-height β sets the height, in pixels, of the titlebar attached to popup shells like the candidate selection window. Kinput2 uses this value to compute the correct popup location of those windows, so don't skip it if you want your windows landing where they should. π―
π WIDGET TREE π
Here's the widget hierarchy of kinput2, in all its branching glory. It's giving family tree at Thanksgiving. π³
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
okay and bestie, that's literally only the beginning β this page keeps going and the rest is also a whole thing. π
β¨ RESOURCES β¨
okay bestie, real talk: there are way too many resources to sit here and describe all of them, and honestly? you don't need most of them anyway. so here's just a lil rundown of the ones you might actually wanna set. π
πΈ Kinput2 application resource
conversionEngineβ tells kinput2 which conversion engine to run with. you pick one of`wnn`,`canna`,`sj3`or`atok`. that's the whole vibe. β¨
π¦ ConversionControl widget (which is a superclass of SeparateConversion, OffTheSpotConversion and OverTheSpotConversion) resource
sendbackKeyPressβ if this one'strue, then theKeyPressevents that kinput2 intercepted but didn't end up using get sent back to the client, but only when there's no conversion text. it's a handy feature ngl, but it can confuse some clients, because likeβ¦ none of the matchingKeyReleaseevents get sent. π also, since thesend_eventflag on those events istrue, some clients straight up won't accept events that kinput2 sends back. for example,ktermwon't accept them unless you specify
KTerm*allowSendEvents: true
in a resource file. the default for the sendbackKeyPress resource is true.
titlebarHeightβ this one sets the height of the title bar that's attached to the various popup shell windows, like the candidate selection and stuff. when it's figuring out where to pop those windows up, kinput2 uses this value so they land in the correct spot. the default is0P.
π OverTheSpotConversion widget resources
shrinkWindowβ if this istrue, the width of the on-the-spot conversion window shrinks to match how long the text on it is. if it's nottrue, the window never shrinks, periodt. if your X server is lowkey bad at resizing windows, maybe set this tofalse. the default istrue.modeLocationβ sets where the status widget lives when you're doing over-the-spot conversion. unless the client says where it wants it, this resource decides. if the value is`topleft`, the widget goes at the top left of the client window. you can also say`topright`,`bottomleft`and`bottomright`. if the value is`tracktext`, the widget sits right under the cursor and follows it around like a lil bestie. but if the region available for conversion is too small, the status gets placed at the bottom left of the client area instead. and if the value is`none`, the status widget never shows up at all. the default is`tracktext`. πmodeBorderForegroundβ if this istrue, the color of the status widget gets forced to match the foreground color of the widget. the default isfalse.useOverrideShellForModeβ if this istrue, the status widget becomes an instance ofOverriddeShellinstead of the defaultTransientShell. turn this on if you're seeing some weird phenomenon where the status widget just keeps flickering and you literally cannot type anything. that happens because of (incorrect) focus management in your window manager, and setting this resource stops any window management for the widget. the tradeoff? the widget gets totally ignored by the window manager, which means you can't move it, resize it, raise it or lower it. π the default isfalse.
π OnTheSpotConversion widget resources
feedbackAttributesβ sets the display attributes of the preedit string when you're using on-the-spot input style. in on-the-spot style, it's the client's job to draw the preedit string, and kinput2 sends along some hints about how it should be drawn, which this resource controls. the value should be a comma-separated list of 4 elements, and each element is the drawing hint for a specific type of string. in order, they're the hints for: not-yet-converted string, converted string, converted string that belongs to the current clause, and converted string belonging to the current sub-clause. each element is made of zero or more drawing attributes, which areR(reverse),U(underline),H(highlight),P(primary),S(secondary) orT(tertiary). go check the Xlib doc for what those actually mean (look at the section about preedit draw callback). the default is`U,,R,H`, which is close to the drawing attributes other input styles use. β
π§ CcWnn (conversion widget using Wnn) resources
jserverβ the hostname of the (primary) jserver used for conversion. if you don't set it, the value of the environment variable`JSERVER`gets used.jserver2ndβ the hostname of the secondary jserver, which gets used if the primary server is down. if you don't set it, kinput2 just doesn't use a secondary server.wnnEnvrc4β the filename of the Wnn conversion environment initialization file. this file is used when the Wnn server (jserver) is version 4. see the Wnn docs for what the file format is. the default is/usr/local/lib/wnn/wnnenvrc.wnnEnvrc6β also a filename for the Wnn conversion environment initialization file. this one's used when the Wnn server (jserver) is version 6. see the Wnn docs for the format.wnnEnvrcβ this one exists for backward compatibility. usewnnEnvrc4orwnnEnvrc6instead, bestie.ccdefβ the input character conversion rule file. the default is/usr/lib/X11/ccdef/ccdef.kinput2.
π Canna (conversion widget using Canna) resources
cannahostβ the hostname of the canna server used for conversion.cannafileβ the Canna conversion customization file.
π Sj3 (conversion widget using SJ3) resources
sj3servβ the hostname of the (primary) sj3serv used for conversion. if you don't set it, the value of the environment variable`SJ3SERV`gets used.sj3serv2β the hostname of the secondary sj3serv, which gets used if the primary server is down.rcfileβ the filename of the Sj3 conversion customization file. the default is/usr/lib/X11/sj3def/sjrc.rkfileβ the Romaji-Kana conversion rule file. the default is/usr/lib/X11/sj3def/sjrk.
π₯ Atok (conversion widget using Atok) resources
serverβ the hostname of the atok server used for conversion.portβ the port number of the atok server.confβ the name of the atok configuration file.styleβ the name of the atok style file.
π«Ά JpWcharDisplay (widget for drawing Japanese text) resources
font,kanjiFont,kanaFontβ these set the font used for displaying ASCII, Kanji and Kana text, respectively. but heads up: since kinput2 changes fonts dynamically based on client requests, the fonts you set here might not actually get used. if you don't specify them, these are the fonts that get 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β every protocol in the kinput protocol family uses X window's selection mechanism to let other clients know the front-end exists. if this istrue, kinput2 uses the selectionJAPANESE_CONVERSION(which is not a standard selection name) in addition to_JAPANESE_CONVERSION. this is for backward compatibility, since a lot of the applications using these protocols still use that non-standard selection. the default istrue.xlcConversionStartKeyβ the key that starts the conversion. it's a hint for clients using the xlc protocol so they know when to request conversion from kinput2. the syntax is a subset of the translation table syntax:
modifier-names<Key>keysym-name
where modifier-names is a combo 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β the keys that start the conversion. the syntax is a subset of the translation table syntax:
modifier-names<Key>keysym-name
where modifier-names is a combo of Ctrl, Shift, Lock, Meta, Alt and Mod[1-5]. a ~ can go before any modifier name, and it means that modifier must not be asserted. for example, if the conversion start key is the `Kanji` key with shift pressed and control not pressed (other modifiers can be pressed or not, whatever), the spec is:
Shift ~Ctrl<Key>Kanji
you can do multiple keys by separating them with newlines. the default is:
Shift<Key>space \n\
Ctrl<Key>Kanji
defaultFontListβ the default fonts to use if the client doesn't specify any fonts of its own. the default is-*-fixed-medium-r-normal--14-*-*-*-c-*.
π«Ά CLIENT SETUP π«Ά
Okay bestie, listen up, because this part is the glue that makes everything actually work. β¨
When you're using the X Input Method Protocol, you have to tell the world which input server you wanna use. No vibes-based guessing here, the client literally needs a name. You can do this two ways:
- by setting the
inputMethodresource, or - by setting the
XMODIFIERSenvironment variable.
Now here's the tea π΅ β some clients straight up don't look at the inputMethod resource, and other clients ignore the XMODIFIERS variable entirely. So the move? Set BOTH. Both of them. That's it, that's the whole strategy. Belt and suspenders, main character energy. π
To use kinput2, you should add this line to your resource file (you know, the ones like .Xresources or .Xdefaults):
*inputMethod: kinput2
and, set XMODIFIERS to @im=kinput2. πΈ
For csh:
setenv XMODIFIERS "@im=kinput2"
For sh:
XMODIFIERS="@im=kinput2"; export XMODIFIERS
That's it. You're set up. Go be bilingual on a keyboard, icon. π
π SEE ALSO π
Go read these too, they're part of the extended universe:
- Wnn documents
- Canna documents
- Sj3 documents
- XIMP protocol specification
- The Input Method Protocol
Not me dropping the whole syllabus. π It's giving "required reading" but make it β¨ canon β¨.
π COPYRIGHT π
Respect the legends who built this, fr fr. All the receipts:
- 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.
π AUTHORS π
The people. The icons. The moment. π«Ά
- Makoto Ishisone, Software Research Associates, Inc.
- Akira Kon, NEC Corporation
- Naoshi Suzuki, Sony Corporation
- MORIBE, Hideyuki
- Kazuki YASUMATSU
- Atsushi Irisawa
And that's a wrap, bestie!! π This whole little love letter is from X Version 11, dated 24 March 1999, and it goes by KINPUT2(1). Now go type something beautiful. πΈβ¨π¦
π¦ where this page comes from
- ubuntu jammy: kinput2-canna 3.1-13build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms