From Fedora Project Wiki
(32 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{autolang|base=yes}}
== Input Method ==
== Input Method ==
An Input Method (IM) is a way to input a certain set of characters and symbols, usually because a keyboard does not directly support them. Chinese, Indic, Japanese. and Korean (CIJK) characters for example, cannot be found in a normal en_US keyboard, thus input methods are required to input these languages.  
An Input Method (IM) is a way to input a certain set of characters and symbols, usually because a keyboard does not directly support them. Chinese, Indic, Japanese. and Korean (CIJK) characters for example, cannot be found in a normal en_US keyboard, thus input methods are required to input these languages.  
Line 57: Line 58:
* http://live.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/InputLanguage
* http://live.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/InputLanguage
* http://live.gnome.org/Design/SystemSettings/RegionAndLanguage
* http://live.gnome.org/Design/SystemSettings/RegionAndLanguage
* http://live.gnome.org/Design/SystemSettings/RegionAndLanguage/W8
* http://live.gnome.org/Design/SystemSettings/RegionAndLanguage/W7
* http://live.gnome.org/GnomeOS/Design/Whiteboards/InitialSetup
* http://live.gnome.org/GnomeOS/Design/Whiteboards/KeyboardShortcuts
* http://live.gnome.org/ThreePointThree/Features/IBus
* http://live.gnome.org/ThreePointFive/Features/IBus
* http://live.gnome.org/ThreePointFive/Features/InitialSetup
* http://fedoraproject.org/wiki/Features/GNOMEIBusIntegration
* http://fedoraproject.org/wiki/Features/GnomeInputIntegration
* http://github.com/gnome-design-team/gnome-mockups/raw/master/input-sources/input-sources-summary.png
* http://meetbot.fedoraproject.org/fedora-meeting/2012-07-16/fesco.2012-07-16-17.01.log.html


Currently the GTK based icon is shown at the bottom in gnome-shell GUI. We'd like to show the icon at the top instead.
Currently the GTK based icon is shown at the bottom in gnome-shell GUI. We'd like to show the icon at the top instead.
Line 64: Line 76:
* [https://github.com/fujiwarat/ibus/commit/50fa73713cae31a09d65f5ff4097458e76df3231 GJS Files]
* [https://github.com/fujiwarat/ibus/commit/50fa73713cae31a09d65f5ff4097458e76df3231 GJS Files]
* [https://github.com/fujiwarat/ibus/commit/4c390e4259cf3f78ef1fd685925d275be4952ed1 IBus Libs]
* [https://github.com/fujiwarat/ibus/commit/4c390e4259cf3f78ef1fd685925d275be4952ed1 IBus Libs]
* http://live.gnome.org/GnomeShell/Extensions/
* http://ueno.fedorapeople.org/ibus-indicator


The part of gnome-shell patch is under [https://bugzilla.gnome.org/show_bug.cgi?id=641531 the discussion]
The part of gnome-shell patch is under [https://bugzilla.gnome.org/show_bug.cgi?id=641531 the discussion]
Line 72: Line 86:
[[File:IBus-GJS4.png|frameless|border|screen shot4 for ibus gjs]]
[[File:IBus-GJS4.png|frameless|border|screen shot4 for ibus gjs]]


{{admon/tip|Currently the development version is available with ibus-1.3.99.20110206-1 in F15 or later.|
{{admon/tip|Currently the development version is available with ibus-1.3.99.20110419-3 in F15 or later.  Here is an instruction how to enable IBus gnome-shell GUI.|
0. Check installed IBus version:
 
<pre>
<pre>
# yum install ibus
# yum install --enablerepo=updates-testing ibus
# yum install --enablerepo=updates-testing ibus-gnome3
# rpm -q ibus
# rpm -q ibus
ibus-1.3.99.20110206-1.fc15.x86_64
ibus-1.3.99.20110419-5.fc15
</pre>
 
1. Logout and login again, or restart gnome-shell from the command-line:
 
<pre>
% gnome-shell --replace
</pre>
 
2. For F16 (gnome-shell 3.1.91 or later), gsettings is needed to enable ibus


# cp /usr/share/ibus/ui/gjs/ibus.js \
<pre>
  /usr/share/gnome-shell/js/ui/status/ibus.js
% rpm -q ibus ibus-gnome3
# cp /usr/share/gnome-shell/js/ui/panel.js \
ibus-1.3.99.20110817-5.fc16.x86_64
  /usr/share/gnome-shell/js/ui/panel.js.orig
ibus-gnome3-1.3.99.20110817-5.fc16.x86_64
# vi /usr/share/gnome-shell/js/ui/panel.js


# diff -u /usr/share/gnome-shell/js/ui/panel.js.orig \
% gsettings get org.gnome.shell enabled-extensions
  /usr/share/gnome-shell/js/ui/panel.js
[]
--- /usr/share/gnome-shell/js/ui/panel.js.orig
% gsettings set org.gnome.shell enabled-extensions "['ibus-indicator@example.com']"
+++ /usr/share/gnome-shell/js/ui/panel.js
% gsettings get org.gnome.shell enabled-extensions
@@ -33,12 +33,13 @@
['ibus-indicator@example.com']
const SPINNER_UPDATE_TIMEOUT = 130;
const SPINNER_SPEED = 0.02;
-const STANDARD_TRAY_ICON_ORDER = ['a11y', 'display', 'keyboard', 'volume', 'bluetooth', 'network', 'battery'];
+const STANDARD_TRAY_ICON_ORDER = ['a11y', 'display', 'keyboard', 'volume', 'bluetooth', 'network', 'battery', 'ibus'];
const STANDARD_TRAY_ICON_SHELL_IMPLEMENTATION = {
    'a11y': imports.ui.status.accessibility.ATIndicator,
    'volume': imports.ui.status.volume.Indicator,
    'battery': imports.ui.status.power.Indicator,
-   'keyboard': imports.ui.status.keyboard.XKBIndicator
+    'keyboard': imports.ui.status.keyboard.XKBIndicator,
+    'ibus': imports.ui.status.ibus.Indicator,
};
if (Config.HAVE_BLUETOOTH)


% gnome-shell --replace
% gnome-shell --replace
</pre>
</pre>
}}
}}
Implemented features for IBus + GNOME-Shell in Fedora 15.
* Show input method engines and keyboard layout engines on IBus StatusIcon active menu.
* Show language names for keyboard layouts and specific symbol chars for input method
  * https://github.com/fujiwarat/ibus/commit/1a7d35e5a29bec75dcc98e934d39cfdb3950ae48
  * http://desktopi18n.wordpress.com/2011/06/23/ibus-icon-symbol-property/
  * Started discussion with IBus upstream.
* new Control + Space key to switch the previous and current engines instead of on/off engine.
  * https://github.com/fujiwarat/ibus/commit/faaea227c58ec17d392ec4ecdf3851e1a52ecd00
  * Probably this won't be upstreamed in IBus in F16 time frame.
* Separate XKB group layouts by engines and all engines are shown in IBus panel menu
  * This feature depends on the new Control+Space key.
  * IBus GJS for GNOME-Shell checks an API if IBus supports the new Control + Space.
* Show a menu item on IBus panel menu to launch g-c-c region.
Implemented features for IBus + GNOME-Shell in Fedora 16.
* Provide ibus-gnome3 from ibus side
* Update icon symbol for each input method engine.
* Fix GLib.Variant for IBus.Config.get_value.
* Fix icon scaling [https://bugzilla.redhat.com/show_bug.cgi?id=718110 bug 718110]
* Fix icon fit [https://bugzilla.redhat.com/show_bug.cgi?id=700472 bug 700472]
* Fix IME based hotkeys [https://bugzilla.redhat.com/show_bug.cgi?id=509478 bug 509478]
ToDo list:
* Start to discuss with GNOME-Shell upstream about the packaging, implementation, integration plan and code reviews.
* Show ibus-setting in g-c-c resion.
Discussion List with Upstream:
* Patch review of [https://bugzilla.gnome.org/show_bug.cgi?id=641531 bug 641531]
* ibus packaging; ibus or gnome-shell
* [https://bugzilla.redhat.com/show_bug.cgi?id=717831 Default ibus icon by desktop]
* Progress about GLib.Variant ([https://bugzilla.gnome.org/show_bug.cgi?id=622344 bug 622344] and [https://bugzilla.gnome.org/show_bug.cgi?id=646635 bug 646635])
* Integration plan for f17
* Design of the list of input methods and keyboard layouts.


== Development ==
== Development ==
Line 115: Line 160:


* [[I18N/InputMethods/Bugs|Bugs]]
* [[I18N/InputMethods/Bugs|Bugs]]
Test Cases:
* https://fedoraproject.org/wiki/QA:Testcase_i18n_ibus_input
* https://fedoraproject.org/wiki/QA:Testcase_i18n_input_method
* https://fedoraproject.org/wiki/QA:Testcase_i18n_input_application

Revision as of 05:52, 20 July 2012

Input Method

An Input Method (IM) is a way to input a certain set of characters and symbols, usually because a keyboard does not directly support them. Chinese, Indic, Japanese. and Korean (CIJK) characters for example, cannot be found in a normal en_US keyboard, thus input methods are required to input these languages.

Note that input methods are not only required by Asian languages, but also useful for other languages such as French on an English keyboard, English on a mobile phone number pad, etc.

Terminology

Input method (IM)
It means the way to input a certain set of characters and symbols. Anthy, Hangal, Cangjie, Shuang Pin, Quan Pin, Wubi, Zhuyin (BoPoMoFo), are input metods. However, input method can also mean Input method system or Input method engine.
Input method system
Also referred as Input method framework or Input method platform, it is a system that provides infrastructure for input methods. Such system itself does not necessary contain any input methods. e.g. iBus, Scim, OXIM. Gcin, IIIMF, uim.
Input method engine (IME)
Also referred as Input method editor, it is a program that actually implement an input method. ibus-chewing and scim-chewing implements the Chewing for IBus and SCIM.
Input method table
An input method in tabluar DB format. Some input methods requires database-lookup but no complex algorithms. ibus-table and scim-table handle this kind of input methods.
Input method map
An input method in m17n data format. Unlike a plain table-base input method, it allows further controlssuch as include, starter, map, variable and command. e.g. Inscript, iTrans, Phonetic input maps for Indic languages, and Thai input methods. This kind of input methods are supported in ibus-m17n and scim-m17n.
Input method framework chooser
A tool for choosing the input method framework, so user can easily switch among IBus, SCIM, UIM, Gcin, and so on. im-chooser and imsettings serves this propose.

Examples

  • iBus - intelligent input bus: next generation input method framework used in F11
  • SCIM is the default input method framework in Fedora 10
  • m17n maps for Indic and other languages
  • uim, a light multilingual input method framework
  • gcin for Traditional Chinese
  • kinput2 for Japanese
  • nabi for Korean
  • imsettings and im-chooser provide a modern control mechanism for input methods on the desktop.

See Virtual Keyboards for on-screen input tools.

Keyboard layout

European languages are generally input with keyboard layouts, which can be switched somewhat like input methods. According to Keyboard layout from Wikipedia, keyboard layout means either:

  • Mechanical: Whether it is a true QWERTY, AZERTY or DVORAK which work in GRUB and BIOS setting.
  • Visual: The arrangement of the legends (markings) that appear on the keys of a keyboard.
  • Functional: The arrangement of the key–meaning associations, determined in software, of all the keys of a keyboard.

Input method system and input method engine should be aware of the the keyboard layout.

Toolkits and Input Methods

GTK and Qt load their input method modules dynamically at runtime.

Warning.png
For advanced users only!
The information below is only intended for advanced users who are comfortable using environment variables to control their environment. General users are strongly recommended to use imsettings through im-chooser to control their desktop input method usage.

GTK IM modules

The input method module (gtk immodule) used by an GTK application can be overridden on the commandline by setting the environment variable GTK_IM_MODULE.

If there is no gtk input method configuration in place then gtk will choose a default immodule based on /etc/gtk-2.0/*-redhat-linux-gnu/gtk.immodules. To disable input method usage in a GTK application entirely, set GTK_IM_MODULE=gtk-im-context-simple.

Qt IM modules

The input method module (qt immodule) used by an Qt application can be overridden on the commandline by setting the environment variable QT_IM_MODULE.

Qt defaults to using XIM by default. To disable input method usage in a Qt application entirely, set QT_IM_MODULE=simple.

XIM

An X Input Method server program needs to be running before it can be used in a legacy X application. The XMODIFIERS environment variable needs to be set in a special way to tell an X application which XIM server to connect to. E.g. XMODIFIERS=@im=SCIM would configure using the scim XIM server.

The XIM input code path also provides X locale compose, ie locale-specific compose sequences which is useful for various "Western" languages (eg ' (dead-acute) + c for pt_BR). This can be used without an XIM server program, eg by setting XMODIFIERS=@im=none.

GNOME-Shell

Currently the GTK based icon is shown at the bottom in gnome-shell GUI. We'd like to show the icon at the top instead.

The following is the patches for IBus:

The part of gnome-shell patch is under the discussion

screen shot1 for ibus gjs screen shot2 for ibus gjs screen shot3 for ibus gjs screen shot4 for ibus gjs

Idea.png
Currently the development version is available with ibus-1.3.99.20110419-3 in F15 or later. Here is an instruction how to enable IBus gnome-shell GUI.
0. Check installed IBus version:
# yum install --enablerepo=updates-testing ibus
# yum install --enablerepo=updates-testing ibus-gnome3
# rpm -q ibus
ibus-1.3.99.20110419-5.fc15

1. Logout and login again, or restart gnome-shell from the command-line:

% gnome-shell --replace

2. For F16 (gnome-shell 3.1.91 or later), gsettings is needed to enable ibus

% rpm -q ibus ibus-gnome3
ibus-1.3.99.20110817-5.fc16.x86_64
ibus-gnome3-1.3.99.20110817-5.fc16.x86_64

% gsettings get org.gnome.shell enabled-extensions 
[]
% gsettings set org.gnome.shell enabled-extensions "['ibus-indicator@example.com']"
% gsettings get org.gnome.shell enabled-extensions 
['ibus-indicator@example.com']

% gnome-shell --replace

Implemented features for IBus + GNOME-Shell in Fedora 15.

  • Show input method engines and keyboard layout engines on IBus StatusIcon active menu.
  • Show language names for keyboard layouts and specific symbol chars for input method
 * https://github.com/fujiwarat/ibus/commit/1a7d35e5a29bec75dcc98e934d39cfdb3950ae48
 * http://desktopi18n.wordpress.com/2011/06/23/ibus-icon-symbol-property/
 * Started discussion with IBus upstream.
  • new Control + Space key to switch the previous and current engines instead of on/off engine.
 * https://github.com/fujiwarat/ibus/commit/faaea227c58ec17d392ec4ecdf3851e1a52ecd00
 * Probably this won't be upstreamed in IBus in F16 time frame.
  • Separate XKB group layouts by engines and all engines are shown in IBus panel menu
 * This feature depends on the new Control+Space key.
 * IBus GJS for GNOME-Shell checks an API if IBus supports the new Control + Space.
  • Show a menu item on IBus panel menu to launch g-c-c region.

Implemented features for IBus + GNOME-Shell in Fedora 16.

  • Provide ibus-gnome3 from ibus side
  • Update icon symbol for each input method engine.
  • Fix GLib.Variant for IBus.Config.get_value.
  • Fix icon scaling bug 718110
  • Fix icon fit bug 700472
  • Fix IME based hotkeys bug 509478

ToDo list:

  • Start to discuss with GNOME-Shell upstream about the packaging, implementation, integration plan and code reviews.
  • Show ibus-setting in g-c-c resion.

Discussion List with Upstream:

Development

Members of the fedora-i18n team are working on development of ibus, imsettings and im-chooser.

Test Cases: