Підручники/Клавіша Compose

From KDE UserBase Wiki
Revision as of 13:40, 30 September 2010 by Yurchor (talk | contribs) (Created page with '* Після перезапуску графічного сервера налаштування мають запрацювати.')

Використання та налаштування використання клавіші Compose

Вступ

Клавішею compose користуються для введення символів, яких немає на звичайних клавіатурах. Такими символами можуть бути символи з умлаутом, знаком протяжності літери, лапки-ялинки тощо:

Наведений нижче опис дій відповідає системі Kubuntu Hardy Heron 8.04.1. Докладніші відомості можна знайти у розділі Посилання і докладніші відомості, наведеному нижче.

Внесені зміни працюватимуть у (майже) всіх програмах, зокрема самому стільничному середовищі, програмах для перегляду інтернету, OpenOffice.org, а також у багатьох консольних програмах та програмах, що працюють у текстовому режимі.

У наведених нижче настановах клавішею compose буде права клавіша логотип (на більшості клавіатур на цій клавіші зображено логотип Windows).

Консольне налаштування

Розпочнімо з класичного підходу, який дає загальний результат, з використанням консолі:

  • Переналаштуйте консоль на використану клавіатуру та кодування символів. Зробіть це у текстовому терміналі або консолі.
$ sudo dpkg-reconfigure console-setup
  • Follow these steps in the configuration:
    • Choose your keyboard (here a default 104 US keyboard)
    • If you want the !AltGr key replacement, choose one
    • Choose which key you would like your compose key to be mapped to. I use the right logo key.

I'd much rather like to use the left logo key, but that's not available in the console setting. But in the graphical window environment (KDE Plasma) that is possible.

    • Choose the console's encoding, set it to UTF-8
    • Choose what character set should be available on the console. I use Combined - Latin; Slavic Cyrillic; Hebrew; basic Arabic

I guess that selection should give me the wanted characters.

    • Choose what type of console output you'd like (do whatever you like, to be safe you can go with the given current defaults)
    • A new initial RAM disk for the next boot will be created now.

Налаштування KDE 3.x

Тепер можна перейти до налаштування нашого стільничного середовища. У цьому описі ми скористаємося Центром керування або інструментом налаштування Kubuntu, за допомогою якого можна відкрити те саме діалогове вікно.

  • Запустіть Системні параметри або Центр керування KDE
  • Перейдіть на сторінку Країна/Регіон та мова (для системних параметрів) або Країна/Регіон і доступність (для Центру керування) -> Розкладка клавіатури
  • Виберіть потрібну вам розкладку клавіатури.
  • Змініть <menuchioce>Параметри xkb</menuchioce> так, щоб клавішу compose було увімкнено.



Налаштування KDE SC 4.x

Now we can go on and configure our windowing environment (Plasma). This description uses the System Settings as they're available in the K-Menu of the Kubuntu install:

  • Start the System Settings
  • Regional & Language</menuchioce>
  • Select the <menuchoice>Keyboard Layout configuration
  • Under the Layout tab, select Enable keyboard layouts
  • Modify Advanced options to select/enable the compose key



Налаштування програм на основі Gtk (Gnome, FireFox тощо)

Gtk (such as also FireFox) and Gnome applications use (on an Ubuntu system) usually SCIM as the input method, not XIM (X Input Method) that relies on the configurations from (X)Compose. Therefore, you will often find that the "a" and "o" macron characters can yield the female/male ordinals "ª" and "º". To still make it work, Gtk applications need to be "told" to use XIM instead.

Налаштування для окремої програми

For a single application you can do it by just setting the environment variable GTK_IM_MODULE for the application to be launched to xim:

$ GTK_IM_MODULE=xim firefox

Постійніше налаштування можна виконати для окремого сеансу роботи оболонки, ось так:

$ export GTK_IM_MODULE=xim

This can, of course, also be persisted for a single user in your ~/.bash_profile, or for all users in /etc/environment. This is, however, the less elegant way, the more elegant way follows below.

Довготривале налаштування

  • Скопіюйте файл налаштувань /etc/X11/xinit/xinput.d/default до /etc/X11/xinit/xinput.d/xim
$ sudo cp /etc/X11/xinit/xinput.d/default /etc/X11/xinit/xinput.d/xim
  • Внесіть зміни до /etc/X11/xinit/xinput.d/xim так, щоб способом введення (input method) для GNOME і KDE був xim
...
 GTK_IM_MODULE=xim
 QT_IM_MODULE=xim
 ...
  • Створіть символьне посилання для локалі all_ALL (або лише для бажаної локалі):
$ sudo ln -sf /etc/X11/xinit/xinput.d/xim /etc/X11/xinit/xinput.d/all_ALL
  • Після перезапуску графічного сервера налаштування мають запрацювати.

Optional Tweaking of XCompose Map

Now that you're using XIM, you can further tweak the XCompose input map for further characters, or for characters in more convenient locations, etc.

To do that follow these steps:

  • Create a ~/.XCompose file, and put the following lines into it:
# ~/.XCompose
 # This file defines custom Compose sequences for Unicode characters

 # Import default rules from the system Compose file:
 include "/usr/share/X11/locale/en_US.UTF-8/Compose"

 # To put some stuff onto compose key strokes:
 <Multi_key> <minus> <greater> : "→" U2192 # Compose - >
 <Multi_key> <colon> <parenright> : "☺" U263A   # Compose : )
 <Multi_key> <h> <n> <k> : "hugs and kisses" # Compose h n k
 <Multi_key> <less> < p> : "< p>

" # Compose < p
  • Just log out and in again (no restart necessary), and you can use your new "multi key short strokes" using the compose key to your desire. As you see this even works for creating longer character sequences.

Typing Macrons, Umlauts, Accents, ...

The compose key will be now whatever you have configured it to be, e. g. right logo.

  • Macrons
compose + shift + hyphen then <vowel >

or

compose + underscore then <vowel >

-->

āēīōū ĀĒĪŌŪ


  • Umlauts
compose + shift + <single quote> then <vowel >

or

compose + <double quotes> then <vowel >

-->

äëïöü ÄËÏÖÜ


  • The German Ess-Zet ligature
compose then s and s (twice the "s")

-->

ß


  • More bindings can be found in /usr/share/X11/locale/en_US.UTF-8/Compose

Links and Further Information