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

Re: Typing characters with byte value greater than 0x7f.



On Tue, 14 Nov 2006 21:26:26 -0500 hendrik@topoi.pooq.com wrote:
> On Wed, Nov 15, 2006 at 01:01:53PM +1100, James Steward wrote:
> > I have searched for some time now for a method by which I can enter
> > characters from (say) ISO 8859-1 in X applications.  In essence
> > I would like to insert a "DEGREE SIGN" into an email for example. 
> > Anyone using codepage 437 on windows or ISO 8859-1 in Linux should
> > see a ° ? (I hope you see it too ;-) I believe.
> > 
> > Now I realise I can achieve this using KCharSelect, but is there a
> > keyboard only way?  Similar to Alt-176 for example?
>
> I have a similar question -- how to enter arbitrary unicode
> characters. My system is configured (to the extent I've been able to
> do it) UTF-8  only, but I still have only the usual characters on my
> keyboard, and  don't know, for example, how to enter hiragana.

Running Sarge here, and I see that if you press Alt-<any_key> or
Alt-Shift-<any_key> in X then you get a vast range of special
characters -- in xterm, at least. Don't know why this is the case.
The degree sign ° results from pressing Alt-0  (Alt-zero).

But my preferred way to type special characters is to use an arbitrary
key as the so-called Compose key. After pressing this key, you enter two
other characters, e.g. e and ' , and the result is é.

Usually, one of the Windows keys is used for this purpose. First, you
have to find the key code of the key you want to use, which can be done
by running xev. For a Windows key, the keycode is usually 115, 116 or
117.

Then as user run this command:

    xmodmap -e "keycode 115 = Multi_key"

(If the keycode you just found differs from 115, use it instead.)

Now it should work.
Press the key followed bij e' or 'e which results in é .
Do not keep this 'compose key' pressed, but release it before entering
e' or 'e .

The degree sign you mentioned results from pressing the compose key
followed by one of these four combinations: 0* *0 0^ ^0

The pairs of characters to be used can be found in
/usr/X11R6/lib/X11/locale/<your_encoding>/Compose
for example:
/usr/X11R6/lib/X11/locale/iso8859-1/Compose


Once it works, you can put the xmodmap command mentioned above into some
startup file, e.g. ~/.xinitrc.
Another method is to create the file ~/.Xmodmap and put this line into
it:

    keycode 115 = Multi_key

My findings with Sarge are that using ~/.Xmodmap works as long as you
log in through gdm. I'm logging in through the console using startx,
which made it stop working for some reason. If that is the case, you can
still put one of these two commands into a startup file like ~/.xinitrc:

    xmodmap -e "keycode 115 = Multi_key"

    xmodmap ~/.Xmodmap

-- 
S.H.



Reply to: