Aaron Konstam wrote: > > It seems to me that there is a point that is being missed. What you type > on the keyboard is just a continuous stream of characters. A line feed > which you get in Linux when you hit return is just a character like any > other. When you hit a g the letter g is printed. When a text editor is > analyzes the line feed it knows to go to the next line. When the shell > sees the line feed it knows it is to treat everything on the line up to > the line feed as a command. No magic is involved and it is really very > simple. > It is on an even lower level that that - when you hit a g, a g may or may not be printed, depending on what is being done with the input. (For example, if I am playing a movie with mplayer, f toggles full screen mode, but is never printed.) Now, there are some libraries that make thing easy for the programmer. The reason that the editing keys work the same in so many programs is that they are using the readline library routines. (man readline) You also have all the terminal control characters that can come into play, depending on the interface and settings. (man stty) Mikkel -- Do not meddle in the affairs of dragons, for thou art crunchy and taste good with Ketchup!
Attachment:
signature.asc
Description: OpenPGP digital signature