NetBSD-Users archive

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

The Chthulhoid horror that is keyboard handling in Unix (Re: Backspace, Delete and other keys)

(not directed at Greg)

On Wed, 31 Mar 2010, Greg A. Woods wrote:

Delete is supposed to be ASCII DEL, which is supposed to delete left.

Ah, that's not MS-Windows fault.  That was a debate started long before
any graphical user interface was ever built.  :-)

See, for instance, <URL:>

There the dilemma is explained as follows:

   In modern systems, the backspace key is often mapped to the delete
   character (0x7f in ASCII or Unicode), although the backspace key's
   function of deleting the character before the cursor remains.

I guess by "modern" the author meant something as new as an ASR-33.  :-)

To those born after the Stone Age of computing, the above doesn't even begin to make sense. "delete character"? It's not a character, it's an operation, it's *something you do*.

What I mean is this: The up arrow key doesn't send a "move cursor up character"[*], Caps Lock doesn't send the "START SHOUTING CHARACTER" followed by the "toggle led character"; and the power key doesn't send a "turn system off character". "delete character"? April Fools isn't until tomorrow, you know.

[*] Although I am sure someone will be glad to point out what VT100 expects...

Before you start, I have already read not only what is on Wikipedia, but also VT100 documentation, Tom Jennings' excellent "Annotated history of character codes", parts of the source of wscons, and have attempted to write a keylogger for X (the horror...) as well as a microcontroller PS/2 keyboard input routine. I know what you old farts are talking about, and some of the reasons why things are as they are; I'm just pointing out that if you take a step back, it all looks pretty absurd here in the 21st century.

And the most absurd thing here is the argument that "the <foo> key is supposed to send the <bar> character". That's just stupid. The user hits the key, and expects the right thing to happen. Whatever happens in between, that's just implementation details. USB or PS/2 keycodes, VT100 emulation, console or xterm -- whatever.

What happens under the hood (and there are a lot of contortions squeezed in for seemingly no good reason) between hitting backspace and seeing a character disappear are not juicy bits of equally-valid choices to be offered to the unsuspecting person in front of the keyboard, that's "stuff I shouldn't have to deal with" and it gets in the way of getting things done. Asking users to set environment variables and mucking around with dot files is the wrong way to go about things, unless the goal is to annoy people.

So -- who's with me on coming up with something better than the current mess?


Home | Main Index | Thread Index | Old Index