easily/safely type unicode characters?
Marcin 'Qrczak' Kowalczyk
qrczak at knm.org.pl
Mon Sep 1 18:45:55 UTC 2008
There is the Compose key, e.g. Compose + ~ + a = ã, Compose + o + c =
(c), Compose + - + - + - = —.
A physical key can be mapped to it in keyboard layout options, but in
the case of my laptop I had to use ~/.Xmodmap instead:
keycode 227 = Multi_key
which maps the Menu key to Compose (and incidentally the Fn key too -
they send the same scancode).
Xlib applications use the compose table from
/usr/share/X11/locale/en_US.UTF-8/Compose
Gtk applications have their own compose table hardwired in Gtk
libraries, which is derived from an older version of the above. Gtk
applications can be told to use the xlib compose machinery by setting
the environment variable (e.g. in ~/.profile):
export GTK_IM_MODULE=xim
but this causes "Ctrl-Shift-u + hex number + Enter" to stop working.
There have been bugs reported for synchronizing the Gtk table with the xlib one:
http://bugzilla.gnome.org/show_bug.cgi?id=88639
http://bugzilla.gnome.org/show_bug.cgi?id=321896
https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/74360
and this is supposed to be fixed, but the fix does not seem to be
present in Hardy yet.
The xlib compose table can be customized in ~/.XCompose. Mine has:
include "/usr/share/X11/locale/en_US.UTF-8/Compose"
<Multi_key> <asterisk> <asterisk> : "•" U2022
<Multi_key> <period> <period> <period> : "…" U2026
<Multi_key> <less> <minus> : "←" U2190
<Multi_key> <minus> <greater> : "→" U2192
<Multi_key> <less> <equal> : "⇐" U21D0
<Multi_key> <equal> <greater> : "⇒" U21D2
<Multi_key> <colon> <parenleft> : "☹" U2639
<Multi_key> <colon> <parenright> : "☺" U263A
<Multi_key> <less> <3> : "♥" U2665
--
Marcin Kowalczyk
qrczak at knm.org.pl
http://qrnik.knm.org.pl/~qrczak/
More information about the ubuntu-users
mailing list