Character shortcuts

Lars Eighner luvbeastie at larseighner.com
Sat Mar 12 23:11:28 UTC 2011


On Sat, 12 Mar 2011, Antonio Olivares 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].
>
> http://www.forlang.wsu.edu/help/keyboards.asp

Several (all?) shells (bash, for one) and many editors will allow you to
enter character codes if you hold the ALT key down and enter three decimal
digits using the numeric key pad with the number lock on (not the number
keys in the row above the letter keys).  The problem is that what character
you see varies according to what font you are using and what character set
you declare.  Freebsd keymaps are fairly easy to understand, and characters
you use frequently can be assigned to key combinations that are easy to
remember if you wish -- but you will not get the results you expect unless
the character is where you expect it to be in the screen font you are using.

For Western European languages, if you want the Euro, iso-8859-15 (aka
Latin9) is perhaps your best choice.  The Euro replaces the squashed bug
from iso-8859-1.

Both of these support, for example, Spanish.  You can choose a Spanish
keymap which will make available characters you are likely to want (tilde n
and N, for examples) as single strokes on your keyboard.  Of course it won't
change the keycaps on a keyboard manufactured for US use, but you can learn
the keys or paint over the keycaps if it is your own keyboard.  For
example, tilde N/n is often the key marked :/; on keyboards made for the US.

The problem with console (VGA, text) fonts is that hardware to support more
than 256 characters AT ONE TIME is not generally available.   To get more
characters at one time you have to draw the characters graphically, which is
to say, you have to use a GUI.  This is why a Windows font (or Xorg) font
can have many more characters - because they draw characters instead of
setting them in the video card.  DOS is just as limited as the FreeBSD
console, so comparing Windows to the FreeBSD console is as unfair as
comparing Xorg fonts to DOS.

> 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.
>
> But the characters after 127 are not printable :( using the pr-ascii script from
> http://tldp.org/LDP/abs/html/wrapper.html

Because there are no ASCII characters above 127.  ASCII is a seven-bit
standard.  127 is the greatest number that can be expressed in seven bits.
VGA supports 8-bit character sets, but no 8-bit character set is ASCII.

> u + 00F1 is the ñ,but I don't know which key combination gives the
> same results as above.

ALT+241  should work in iso-8859-1 (does not have the Euro) and
iso-8859-15 (has the Euro).

Gui editors that support unicode generally allow you to select characters
that are not on the keyboard from a grid. Those editors may or may not have
short cuts for character you use frequently.

>  A script/program(C,C++) that would generate
> the characters would be nice, but if there is a key combination that
> could be used to generate the special letters.
>
> Thanks in Advance,
>
> Antonio
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>
>

-- 
Lars Eighner
http://www.larseighner.com/index.html
8800 N IH35 APT 1191 AUSTIN TX 78753-5266


More information about the freebsd-questions mailing list