Difference between revisions of "Input methods"

From Trinity Desktop Project Wiki
Jump to navigation Jump to search
(Added "Input Methods" page based on TQt's README.immodule)
 
(Moved content from uncategorised "IBus" page)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
TQt comes with ''<tt>immodule</tt>'', a modular, extensible input method subsystem. The main goal of <tt>immodule</tt> is to extend and enhance the input method support in the TQt library, in order to provide a modern and powerful multi-language input system, and is similar to the <tt>immodule</tt> for GTK+.
 
TQt comes with ''<tt>immodule</tt>'', a modular, extensible input method subsystem. The main goal of <tt>immodule</tt> is to extend and enhance the input method support in the TQt library, in order to provide a modern and powerful multi-language input system, and is similar to the <tt>immodule</tt> for GTK+.
  +
  +
__TOC__
  +
   
 
== Installation ==
 
== Installation ==
 
<tt>immodule</tt> is part of the standard TQt distribution.
 
<tt>immodule</tt> is part of the standard TQt distribution.
   
<tt>immodule</tt> provides two additional <tt>./configure</tt> options. Choose 'Binary Compatible' for normal use.
+
<tt>immodule</tt> provides two additional <tt>./configure</tt> options:
   
 
{| class="wikitable"
 
{| class="wikitable"
Line 10: Line 13:
 
! Description
 
! Description
 
|-
 
|-
| <code>./configure -inputmethod</code>
+
| <syntaxhighlight lang="shell-session">$ ./configure -inputmethod</syntaxhighlight>
| Build TQt with 'Binary Compatible' immodule support (default)
+
| Build TQt with 'Binary Compatible' immodule support '''(default)'''
 
|-
 
|-
| <code>./configure -inputmethod -inputmethod-ext</code>
+
| <syntaxhighlight lang="shell-session">$ ./configure -inputmethod -inputmethod-ext</syntaxhighlight>
| Build TQt without binary compatibility, but supports more advanced <tt>immodule</tt> extensions. It cannot be used with ordinary application binaries (i.e. the option is for developers)
+
| Build TQt without binary compatibility, but supports more advanced <tt>immodule</tt> extensions.
  +
It cannot be used with ordinary application binaries (i.e. the option is for developers)
 
|}
 
|}
  +
  +
You should choose 'Binary Compatible' for normal use.
  +
   
 
== How to use ==
 
== How to use ==
Line 22: Line 29:
   
 
* Run <code>tqtconfig</code> to choose your favorite XIM input style
 
* Run <code>tqtconfig</code> to choose your favorite XIM input style
  +
  +
=== IBus ===
  +
IBus is a multilingual input method commonly used for input in languages like Chinese.
  +
  +
IBus works is confirmed to work with Trinity, with the changes below:
  +
  +
  +
'''1. Applications need this variable in their environment:'''
  +
  +
<syntaxhighlight lang="shell-session">
  +
$ export XMODIFIERS=@im=ibus
  +
</syntaxhighlight>
  +
  +
You can add it in your ~/.bashrc or in the terminal just before launching the application.
  +
  +
  +
'''2. IBus daemon needs to be in XIM mode'''
  +
  +
<syntaxhighlight lang="shell-session">
  +
$ ibus-daemon --xim -d
  +
</syntaxhighlight>
  +
  +
  +
'''3. Enable the "Embed preedit text" option.'''
  +
  +
Otherwise it appears at the bottom left corner of the window.
  +
  +
Right-click on the IBus applet, go to <code>Preferences</code> and enable the "Embed preedit text in application window" option.
  +
  +
  +
====Known pitfalls====
  +
* If QT_IM_MODULE is defined (even if it is empty), it blocks IBus. Make sure it's not set anywhere. Remove it from any file, like <tt>~/.xprofile</tt> or <tt>~/.bashrc</tt>.
  +
  +
* You need to launch IBus first.
  +
  +
* If IBus is closed while an application is using it, the app will crash.
   
   
Line 32: Line 75:
 
! Description
 
! Description
 
|-
 
|-
  +
| <syntaxhighlight lang="shell-session">
| <code>export TQT_IM_MODULE=xim</code>
+
$ export TQT_IM_MODULE=xim
  +
</syntaxhighlight>
 
| Set "xim" input method as default
 
| Set "xim" input method as default
 
|-
 
|-
  +
| <syntaxhighlight lang="shell-session">
| <code>export TQT_IM_MODULE=simple</code>
+
$ export TQT_IM_MODULE=simple
  +
</syntaxhighlight>
 
| Set "simple" composing input method as default
 
| Set "simple" composing input method as default
 
|-
 
|-
  +
| <syntaxhighlight lang="shell-session">
| <code>export TQT_IM_SWITCHER=imsw-none<br>export TQT_IM_MODULE=xim</code>
+
$ export TQT_IM_SWITCHER=imsw-none
  +
$ export TQT_IM_MODULE=xim
  +
</syntaxhighlight>
 
| Set "xim" input method as default, and disable input method selection menu in the context menu*
 
| Set "xim" input method as default, and disable input method selection menu in the context menu*
 
|-
 
|-
  +
|
| <code>export TQT_IM_SWITCHER=imsw-multi<br>export TQT_IM_MODULE=xim</code>
 
  +
<syntaxhighlight lang="shell-session">
 
$ export TQT_IM_SWITCHER=imsw-multi
  +
$ export TQT_IM_MODULE=xim
  +
</syntaxhighlight>
 
| Set "xim" input method as default, and enable input method selection menu in the context menu* (default configuration)
 
| Set "xim" input method as default, and enable input method selection menu in the context menu* (default configuration)
 
|-
 
|-
  +
| <syntaxhighlight lang="shell-session">
| <code>export TQT_IM_SWITCHER=imsw-none<br>export TQT_IM_MODULE=iiimqcf</code>
+
$ export TQT_IM_SWITCHER=imsw-none
| Set "iiimqcf" that has its own input method switching framework as default, and disable input method selection menu in the context menu. Such configuration is required by some system integrators to provide unified user interface for global input method switching over the desktop
 
  +
$ export TQT_IM_MODULE=iiimqcf
  +
</syntaxhighlight>
  +
| Set "iiimqcf" that has its own input method switching framework as default, and disable input method selection menu in the context menu.
 
Such configuration is required by some system integrators to provide unified user interface for global input method switching over the desktop
 
|}
 
|}
   
Line 52: Line 110:
   
 
== Links ==
 
== Links ==
* [http://immodule-qt.freedesktop.org/ immodule-qt web-site]
+
* [http://web.archive.org/web/20040930060824/http://immodule-qt.freedesktop.org/ Archived immodule-qt web-site (2004/09/30)]
 
* [https://mirror.git.trinitydesktop.org/gitea/TDE/tqt3/raw/branch/master/README.immodule README.immodule in the TQt source repository] (this article was based on this README)
 
* [https://mirror.git.trinitydesktop.org/gitea/TDE/tqt3/raw/branch/master/README.immodule README.immodule in the TQt source repository] (this article was based on this README)
   

Latest revision as of 17:50, 1 January 2022

TQt comes with immodule, a modular, extensible input method subsystem. The main goal of immodule is to extend and enhance the input method support in the TQt library, in order to provide a modern and powerful multi-language input system, and is similar to the immodule for GTK+.


Installation

immodule is part of the standard TQt distribution.

immodule provides two additional ./configure options:

Options Description
$ ./configure -inputmethod
Build TQt with 'Binary Compatible' immodule support (default)
$ ./configure -inputmethod -inputmethod-ext
Build TQt without binary compatibility, but supports more advanced immodule extensions.

It cannot be used with ordinary application binaries (i.e. the option is for developers)

You should choose 'Binary Compatible' for normal use.


How to use

  • See users manual of each input method plugins
  • Run tqtconfig to choose your favorite XIM input style

IBus

IBus is a multilingual input method commonly used for input in languages like Chinese.

IBus works is confirmed to work with Trinity, with the changes below:


1. Applications need this variable in their environment:

$ export XMODIFIERS=@im=ibus

You can add it in your ~/.bashrc or in the terminal just before launching the application.


2. IBus daemon needs to be in XIM mode

$ ibus-daemon --xim -d


3. Enable the "Embed preedit text" option.

Otherwise it appears at the bottom left corner of the window.

Right-click on the IBus applet, go to Preferences and enable the "Embed preedit text in application window" option.


Known pitfalls

  • If QT_IM_MODULE is defined (even if it is empty), it blocks IBus. Make sure it's not set anywhere. Remove it from any file, like ~/.xprofile or ~/.bashrc.
  • You need to launch IBus first.
  • If IBus is closed while an application is using it, the app will crash.


Environment variables

Some environment variables are available for expert users and system integrators. See following examples to use the variables.

Example Description
$ export TQT_IM_MODULE=xim
Set "xim" input method as default
$ export TQT_IM_MODULE=simple
Set "simple" composing input method as default
$ export TQT_IM_SWITCHER=imsw-none
$ export TQT_IM_MODULE=xim
Set "xim" input method as default, and disable input method selection menu in the context menu*
$ export TQT_IM_SWITCHER=imsw-multi
$ export TQT_IM_MODULE=xim
Set "xim" input method as default, and enable input method selection menu in the context menu* (default configuration)
$ export TQT_IM_SWITCHER=imsw-none
$ export TQT_IM_MODULE=iiimqcf
Set "iiimqcf" that has its own input method switching framework as default, and disable input method selection menu in the context menu.

Such configuration is required by some system integrators to provide unified user interface for global input method switching over the desktop

* Input method selection menu might not be available in some TDE apps.


Links