<?xml version="1.0" encoding="utf-8"?>
<cigml xmlns="http://www.eleves.ens.fr/home/george/cigml"
  lang="en"
  >
  <head>
    <title>Termim: documentation</title>
    <ilink href="./">Termim</ilink>
  </head>
  <body>

    <title>Termim: documentation</title>

    <table-of-contents depth="2"/>

      <p>
	Please note that the up-to-date and complete user documentation is
	in the manual page and text files that comes with termim. This page
	is only a quick rewrite.
      </p>

      <section>
	
	<title>Principle</title>

	<p>
	  Termim creates a pseudo-tty device and starts a shell inside. Then
	  it filters user input to provide input methods. The filtering is
	  as minimal as possible in order not to mess up with special key
	  escape sequences that it does not know.
	</p>

      </section>

      <section>
	
	<title>Configuration</title>

	<p>
	  Termim needs a configuration file to work. This file defines the
	  key sequences used to change the input method. If the environment
	  variable <code>TERMIMRC</code> is set, termim uses it as the path
	  to the configuration file. Else, it tries <code>~/.termimrc</code>
	  and then a hardcoded default (maybe
	  <code>/usr/local/etc/termimrc</code>). The exact syntax of this
	  file is described in the manuel page. Here is a quick glance of
	  the possible directives:
	</p>
	<ul>
	  <li><code>map "<i>name</i>"</code><br />
	    Defines a new keymap.</li>
	  <li><code>key "<i>sequence</i>" set_map "<i>name</i>"</code><br />
	    Binds a key to a keymap change.</li>
	  <li><code>key "<i>sequence</i>" string "<i>string</i>"</code><br />
	    Binds a key to a fixed UTF-8 string.</li>
	  <li><code>key "<i>sequence</i>" macro <i>key</i>
	      [<i>key</i>...]</code><br />
	    Binds a key to sequence of keys that are fed back to the input
	    method.</li>
	  <li><code>default "<i>name</i>"</code><br />
	    Sets the default handler for this keymap, this is how the real
	    input method system is done.</li>
	</ul>

	<p>
	  All keys in bindings are named by the escape sequence they send to
	  the terminal; Termim does not use terminfo nor termcap. Keys in
	  macro are either numeric key codes (in theory in range 0–255) or
	  named special keys (some input methods may define such keys, like
	  the X11 Multi_key — none are currently defined).
	</p>

	<p>
	  Some of the usual escape sequences are available in the string
	  constants (keys escape sequences and litteral strings), including
	  <code>\x<i>XY</i></code>. There is also the
	  <code>\u<i>number</i>\</code> escape sequence that stands for the
	  UTF-8 representation of the Unicode character
	  <code><i>number</i></code>.
	</p>

      </section>

      <section>
	
	<title>Input methods</title>

	<p>
	  The name in double quotes is the argument to the
	  <code>default</code> directive in the <code>termimrc</code> file
	  to get this input method. There is a more accurate description of
	  the input methods in the <code>doc</code> directory of the
	  distribution.
	</p>

	<section>

	  <title>Transparent behaviour: “<code>copy</code>”</title>

	  <p>
	    This input method does nothing. It is intended to be used for
	    the default mode, when the keys do what they do normally.
	  </p>

	</section>

	<section>

	  <title>Western languages using compose: “<code>western</code>”</title>

	  <p>
	    This input method allows to type special characters of most
	    western languages (including French, German…) by using a compose
	    key. The compose key must be defined using the <code>key
	      "<i>sequence</i>" macro compose</code> directive.
	  </p>

	</section>

	<section>

	  <title>Translation input methods: “<code>greek</code>”,
	    “<code>cyrilic</code>”, “<code>hebrew</code>”,
	    “<code>thai</code>”, “<code>arabic</code>”</title>

	  <p>
	    These input methods use a simple translation mechanism to allow
	    to type several languages using a standard ASCII keyboard.
	  </p>

	</section>

	<section>

	  <title>Simplified Chinese: “<code>tonepy</code>”</title>

	  <p>
	    This input method allows to type simplified Chinese using the
	    characters pronounciation. Possible choices are shown on the
	    status line.
	  </p>

	</section>

	<section>

	  <title>Japanses: “<code>japanese</code>”</title>

	  <p>
	    This input method allow to type Japanese, including kanji.
	  </p>

	</section>

	<section>

	  <title>Korean: “<code>korean</code>” and
	  “<code>hangul</code>”</title>

	<p>
	  These two input methods allow to type Korean, the first using
	  translitteration, and the second imitating a Korean keyboard
	  layout.
	</p>

	</section>

      </section>

  </body>
</cigml>
