Some simple programs in C.
See:
Contents
Notes
Detecting ASCII Key Codes
from
Linux Backspace/Delete mini-HOWTO
:
The following C one-liner
void main(void) {int c; while(c = getchar()) printf("%d 0x%02X\n", c, c);}
may help you. Put the line into a file named ascii.c, compile it with gcc ascii.c -o ascii, type ./ascii and press a key followed by RETURN. The program will display the decimal and hexadecimal codes of the ASCII sequence produced (you may want to do a stty erase ^- first to get really all the codes). Now you can easily see what Backspace key does: if it emits a DEL (127), you have a standard emulator, if it emits a BS (8) you have a deviant one.
Contributors
- () RandyKramer - 14 Apr 2003
- If you edit this page: add your name here; move this to the next line; and include your comment marker (initials), if you have created one, in parenthesis before your WikiName.
Page Ratings