Character shortcuts

Polytropon freebsd at
Sat Mar 12 21:43:40 UTC 2011

On Sat, 12 Mar 2011 14:07:59 -0600, Antonio Olivares <olivares14031 at> wrote:
> Dear FreeBSD experts,
> There has been something that I find hard to do, I would like to find
> a CTRL + KEY combination, or ALT + KEY combination to input special
> characters like (ñ)  [ALT + 164 or ALT + 0241 in Mr. Gates OS].
> accents other symbols like copyright, euro, etc.  I would like to do
> the same(have a special key combination) to get the characters in
> FreeBSD too, but googling have not found something that works.  I even
> tried to run a litte program in the shell to generate the characters
> to use for cutting + pasting to no avial.

Depending on your keyboard and language settings, many
characters can be generated by Alt+Letter. There is also
a COMPOSE key on some keyboards - and those that don't
have it can be told to do so by xmodmap. Using the
COMPOSE approach, you combine a letter with an accent
or any other symbol, and if there is a matching result
in your character set (or font), it will be displayed.

Here are some examples:

	Compose a a -> å (svedish a-circle)
	Compose s s -> ß (german Eszett ligature)
	Compose U " -> Ü (german U Umlaut, capital)
	Compose L / -> Ł (polish L-stroke, capital)
	Compose a , -> ą (polish a-comma)
	Compose o / -> ø (danish o-stroke)
	Compose k k -> ĸ (greek kappa)
	Compose n ' -> ń (n with accent grave)

And of course: Compose n ~ -> ñ.

Depending on how characters like `, ´, ^ or ~ are handled
(single character immediately output, or combination
character that waits for the next letter to automatically
construct a new one), Compose may be needed or not. On the
default german keyboard setting, 'e gives é, ~n gives ñ
and ^a gives â immediately without using Compose.

My ~/.xmodmaprc contains (along with other lines):

	add mod4 = Multi_key
	keycode 117 = Multi_key

You can find out the keycodes using the "xev" program.

Your keyboard settings maybe sets other characters than
can be created with Alt+letter or AltGr+letter (the
german keyboard's right Alt key is labeled AltGr, or
Alt Graph on my Sun keyboard), e. g. ¬¹²³¼½¬{[]}\
@ł€¶ŧ←↓→øþþ¨ æßðđŋħjĸł˝^ «»¢“”nµ·, and with Shift
¬¡⅛£¤⅜⅝⅞™±°¿¿˛ ΩŁ€®Ŧ¥↑ıØÞ˚ ƧЪŊĦJ&Ł˝ˇ ¦<>©‘’Nº×÷.

So instead of memorizing arbitrary numbers as in MICROS~1
land, you can see a relation between the letter and the
key you need to press in order to generate it. You can
also rearrange them if you feel a need for that. :-)

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list