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

Re: special keyboard characters




> is there any standard reference for creating special characters under
> linux that do not appear on a standard us keyboard? or is it application
> specific?

It *is* usually application specific.

The easiest way, and the way that works universally on all PCs, is to
press down the ALT key. While the ALT key is down, punch in the ASCII code
of the character that you want on the keypad to the right. (i.e., don't
use the numbers on top). Then let go of the ALT key. You should see your
funky character on the screen. If you try this with telnet, you may need
to first open an editor in order for it to display.

So, for example, if I wanted "e with an accent" like in the properly
funkified version of "resume", I would hold down ALT with my left hand and
type 130 in with my right hand. This works in M$ Word, Linux's Pico, & a
bunch of other stuff.

For command-line funk, you will need to figure out the octal (not ASCII)
code for the character in question. For example, the octal code for "a" is
141. So, here's how I get a lower-cased "a", assuming my A key is broken:

Bash shell:

   echo -e "\141"

Perl:

   perl -e 'print "\141\n";'

Finally, here's a little C program I wrote that works kinda like BASIC's
CHR function. It uses ASCII codes as an argument. So, you would just type
"chr 97" to see a lower-cased "a".

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
   char c[] = {atoi(argv[1]), '\0'};

   printf("%s\n", c);

   return EXIT_SUCCESS;
}

-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.