Re: how to enter accent characters



On Wed, May 07, 2003 at 02:53:22PM -0700, Raul Acevedo wrote:
> I apologize if this is obvious or the wrong place to ask... but how do I
> enter simple accented characters into a GNOME 2 application, without
> using the Character Palette applet?
> 
> I've looked over an hour online, and while there's plenty of info on
> technical details of i18n, gtk input method code, and input method
> selection, I haven't found anything that says how to simply enter a
> single accented character into a GNOME app.  Help!

Two methods:

(1) Set up your keyboard so that one of the keys plays the role of
Multi_key. You may already have a key that does this (on some keyboard
layouts, it's the AltGr key). If you do not, you can set it up by
putting a line like this in your .xsession or .xinitrc file:

	xmodmap -e "keycode 116 = Multi_key"

Here, 116 was a keycode I found by running xev and pressing a key I do
not otherwise use on my keyboard (the righthand "windows" key in this
case). You can use any keycode here.

Once you have set up the Multi_key, you use it to indicate that the next
two keystrokes should be combined. So, for example, <Multi> <=> <C> will
give you € and <Multi> <'> <a> gives á. The full list of possible
combinations is in the file gtk/gtkimcontextsimple.c from the GTK+
source distribution. There may be a more accessible list somewhere, but
I don't know where it is.

(2) Most places that use GTK+ to get their input will permit you to
enter the hexadecimal code for a Unicode character by pressing <ctrl>
and <shift> simultaneously and then entering two to four hex digits
(while holding down <ctrl> and <shift>). This method does not work
everywhere -- one notable exception being gnome-terminal, where
<ctrl>-<shift>-<c> has been overridden to mean "copy". However, this
method does work in many places.

On the balance, the first method is much easier (the key combinations
are fairly mnemonic) and workds everywhere. The latter method is nice
when you want a character that is not available as a composition of
keypresses.

Cheers,
Malcolm

-- 
What if there were no hypothetical questions?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]