OT What does RET (Enter) do and how does it do it ??

Alan Cox alan at lxorguk.ukuu.org.uk
Sun Aug 26 19:28:49 UTC 2007


> Except the keyboard produces 0x0d for the enter key (carriage return or
> C/R).  The Unix or Linux software  translates that to linefeed (0x0A).

Actually the keyboard produces a scancode. What that is translated into
depends entirely on your keymaps (see man loadkeys) under the console, or
your X keysym maps (see Xkb) under X11. For terminals its then controlled
further by the termios settings (so in ancient times you could deal with
the fact nobody could agree whether line-feed or carriage-return was the
button in question (ditto del v backspace)

Its also the same mess that gives us tools like dos2unix (DOS uses both
linefeed and carriage-return for new line marks, and like CP/M ^Z for EOF
markers)




More information about the fedora-list mailing list