55 comments

[ 3.2 ms ] story [ 105 ms ] thread
Not mentioned in the article is that ENQ is a standard ASCII character (0x05, and previously abbreviated WRU for “Who are you?”) that causes the device on the other end of the line to send back its answerback message.

On electromechanical teletypes¹ the answerback message was ‘programmed’ by breaking off tabs from a rotating drum, like an inverse music box.

¹ https://en.wikipedia.org/wiki/Teletype_Model_33

Curiously, there's even a Unicode glyph representing the ENQ command: ␅

(This is part of the broader collection of C0 glyphs: https://en.wikipedia.org/wiki/Unicode_control_characters#Con...)

I was curious how it worked and I found a picture of the answerback 'drum' where you break off tabs (lower left):

http://www.pdp8.net/asr33/pics/main_back.shtml

> In the lower left is the answer back drum. By breaking off the little tabs where you program a 20 character sequence that the teletype can send when the "HERE IS" key is pressed or if enabled when the WRU (ENQ, ascii 5) character is received.

It seems you actually break off the tabs, it's not just a repeatable customizable configuration.

Breaking off the tabs is permanent on the low end Teletype Model 33, although you could get a new blank wheel. The high end Model 28 (5-bit) and Model 35 (8-bit) had a set of removable tines you could replace one character at a time.[1]

It's a reminder of how painfully hard it was to store data, even in read-only form, prior to the 1970s.

[1] https://youtu.be/0A1a9rW_XRs?t=315

It sounds like this was an automatic thing, the host could query the terminal and would get a response without any user input.

So that still leaves me with the question of why the key exists?

What use cases would you have for voluntarily sending the host your "identification"? Was this used for authentication?

It's for Telex service. You dialed up another Teletype machine to send a message to it. At startup, the other end was interrogated to print its answer-back on both Teletypes, to confirm that you'd reached the right destination. Then you could type to the other end, or send a paper tape and have it print or punch at the other end.
It is kinda funny that Apple didn't do anything about Caps Lock when they redesigned their keyboard with the touch bar.

I cannot imagine professionals or casual users who would need quick access to turning caps lock on and off. When you need caps lock over shift, it is because you are planning to write a lot of all cap text, and so, taking a second to turn it on via the touch bar seems okay. It is prime to be relegated to the touch-bar, while plenty of professionals use ESC all the time while touch-typing.

While they were at it, the switch window `command+~` short cut is almost unreachable on non-us like keyboard layouts.

If they were gonna break professional users keyboard workflow, why not fix some of the more glaring mistakes in current keyboard layout while they were at it?

You can map caps lock to escape (I map it to control). The bigger complaint I have heard is muscle memory from vim people used to the Mac layout.
Control not being in the corner also trips a lot of people up.
It's much more ergonomically convenient to have the command key under the thumb. I had issues with this only for the first two weeks after moving to Mac and now it's natural.
Ok, but I'm talking about Control, not Command. And on mac laptops, the corner is taken up by the Function key instead of Control.
Ah, I swapped control with alt long ago so it's under my thumb too.
I've been mapping Caps Lock to = for ages now. Started to do this due to gaming - a very convenient easy to reach key; translated to software development quite handy too.
Well, who would you rather fight, people who rely on CAPS LOCK or people who rely on Escape?
yeah I always remap caps lock to control, however this gets me into trouble when I help out a coworker on their machine.
> Apple didn't do anything about Caps Lock

They did. Under System Preferences > Keyboard > Modifier Keys… you can now map Caps Lock to Escape which you couldn’t before. It’s just not activated by default.

> the switch window `command+~` short cut is almost unreachable

Change it under System Preferences > Keyboard > Shortcuts > Keyboard: Move focus to next window

Defaults are a very powerful thing.

Particularly with the caps-lock key I don't see why it takes up so much real estate.

> Change it under System Preferences > Keyboard > Shortcuts > Keyboard: Move focus to next window

It is not like Apple doesn't know my locale. Why isn't it set up for easy use on it?

On the other hand, I do wonder what went into designing local keyboard variants. Many are quite hostile towards common programming characters, to the point where I actually use a US keyboard, despite it missing 3 letters from my native language's alphabet!

> Particularly with the caps-lock key I don't see why it takes up so much real estate.

History, removing it outright would likely have caused more consternation than the escape key change.

Blame this one on defaults all you want, but keyboards actually have defined layouts for keys, the touchbar is probably the best way of easing into changing that. But you can't boil the ocean and all that.

> On the other hand, I do wonder what went into designing local keyboard variants. Many are quite hostile towards common programming characters, to the point where I actually use a US keyboard, despite it missing 3 letters from my native language's alphabet!

Also history, in the English case, the keyboard variants were designed will before computers and programming languages. Starting in 1870 for most typewriters in English, and moving from there. I highly doubt any design went into any local variants and computer programming simplicity.

> Defaults are a very powerful thing.

So true. That's why companies make so many user-hostile settings as opt-out.

> They did. Under System Preferences > Keyboard > Modifier Keys… you can now map Caps Lock to Escape which you couldn’t before.

You've been able to do that for at least a couple of years now.

Before Sierra, you could only map to Control but not Escape.
Huh ok, I only ever map it to Control so I didn't pay too much attention. Good to know.
There was software such as PCKeyboardHack/Karabiner and something else before that that let you do remappings not available through Keyboard Preferences. Every Mac OS X release breaks keyboard internals and things like PCKeyboardHack stop working (Sierra was out for almost a year before Karabiner Elements was fully functional). Mac OS X support for custom keyboard layouts is atrocious, and IMO Macbook keyboards are garbage compared to shaped (models up to x220/t420) Thinkpad keyboards. If you look around at some of the different keyboard layouts and try some remappings out what you will probably find is that remapping Caps Lock to Backspace is the best for general typing (this started with the MIT AI Lab's "Knight TV" terminals designed by Tom Knight). I haven't tried it but this should be possible with Karabiner Elements in Sierra now.
I have a project that provides a little tool for Windows and a lot of documentation for Windows, Linux and Mac to map Caps Lock to Escape as well as remapping keys in general.

Project URL: https://github.com/susam/uncap#uncap

It's not so hard to create a keyboard layout using the Microsoft Keyboard Layout Creator (MSKLC) [0]. I don't know if it can do everything that uncap can, but I'm pretty sure it can do most things, and it doesn't need a separate program to be running, because the keyboard layout is just installed as part of Windows.

A number of my favourite keyboard layouts are at http://keyboards.jargon-file.org/ (notably Pseudo-VT320, which turns AltGr into a Linux-like compose key).

It looks a bit old, but works fine under Windows 8 and 10.

[0] https://msdn.microsoft.com/en-us/globalization/keyboardlayou...

You cannot remap Caps Lock key with Microsoft Keyboard Layout Creator. If it were really that straightforward, then Vim users would not be forced to rely on registry hacks or tools like Uncap or AutoHotKey to map Caps Lock to Escape [0].

If you dislike editing Windows registry like me, you need a separate program to be running.

[0]: http://vim.wikia.com/wiki/VimTip75

On my Irish keyboard layout (and therefore presumably the UK one also), it's mapped to command-` by default, i.e. the same physical keys as command-~ on a US keyboard. This is also common across every OS for shortcuts relying on tilde in video games for example)
On my old Thinkpad X1 Carbon, the Caps Lock key was replaced with Home and End keys. I thought it was a brilliant idea, although I immediately remapped them to Backspace and Control respectively. The laptop also had a primitive touch-bar in place of the function keys which I actually rather liked, although the implementation was lacking. (And, unlike Apple, they kept a physical Esc key!)

Unfortunately, both of these changes were not particularly popular. I think people only disliked the Home/End keys in place of Caps Lock because it was weird and different—I saw a lot of whining online, but nobody ever complained about not being able to use Caps Lock any more!

To some extent, I see where people are coming from: I regularly use at least two different external keyboards as well as my laptop keyboard, so it's hard to get used to a weird layout in just one place out of three. I'm an early adopter at heart and willing to power through the inconvenience for what I see as a better design but I also understand that it's too much bother for other people. (And, honestly, the upside isn't that big!)

On later generations, ThinkPad switched back to a more standard layout. I wouldn't be surprised if Apple wanted to avoid a similar reaction in changing the keyboard layout too much, especially since their touchbar was already a big enough change to stir up controversy.

image of said keyboard: https://goo.gl/images/mgQ2nj

I get your point about switching keyboards can get confusing, as well as it looks kinda weird at first, which is definitely enough to make people complain.

Good points.

I couldn't stand this layout. The entire change was driven by the soft-key function row, which was pretty awful. The 1st gen X1 Carbon had a fully functional keyboard with no need for soft keys, and it worked perfectly, so the frustration was compounded by feeling like they tried to fix something that wasn't broken.

The soft keys forced the home/end keys out, as well as the Escape key and the Delete key. Home/end landed on CapsLock, which was then relegated to a double-tap of the shift key. The double-tab feature was so sensitive that it could be activated just by typing normally, which suddenly would activate capslock.

To add to the confusion, the Escape key landed on the ~ key's location, which then had to be relocated to the right-hand windows key placement.

The delete key was jammed in by cutting the Backspace key in half and putting it there.

It took weeks of pure frustration and anger for me to even begin getting used to all this. The experience permanently turned me against soft touch bars on the function key row.

Caps Lock is a very fast tool for typing capital letters. Yes, toggling Caps Lock on/off for capital letters can be faster than using Shift.

One of the world's fastest typists uses this technique: http://seanwrona.com/typing.php

>I cannot imagine professionals or casual users who would need quick access to turning caps lock on and off.

Then you have a very limited imagination. There are lots of reasons that people need and use caps lock.

Off the top of my head-- Broadcast jorunalism. Every news story you hear on TV or radio is written in all caps. The same is true of the speeches by most professional public speakers.

But do they need to quickly switch it on and off? If you read more of my post, you will see that I address this very point.
I'm sad to say it's still very commonly used by CAD jockeys, as graphical conventions dictate that much of the textual detail in construction documents should be in all-caps. Of course you'd think a "sophisticated" BIM system like Revit could handle this for you automatically, and yet...
In that case wouldn't you just turn capslock on and do your work? Or do you need to turn it on and off constantly?

If not, moving capslock to the touch bar is not a real problem.

I'm going to be anecdotal again, but I use caps lock fairly regularly when I'm writing code. It's very useful for COMPILE_TIME_CONSTANTS and MY_MACRO_THAT_SCARES_SMALL_CHILDREN in C++ code especially.
Maybe they actually learned something after they mixed up the position of fn and ctrl with no way to fix it.

Was one of a few serious ux problems that made me leave Apple only three years after initially being very exited about it.

I seem to remember that being used as an attack vector at college: Identify a terminal that was logged on as root (albeit physically inaccessible), then find a way of getting message to it, then send a string that programmed answerback and then triggered it. Usual payload was moving your 'special' version of a common suid program into place, possibly along with a tweaked version of 'sum'.

This started with 'write' etc. but became an escalating arms-race.

Do you happen to know if this is still supported in eg. xterm?
There are VT100/ANSI codes to program not only the answerback message, but also the function keys. All terminal emulators that I know of, including xterm, removed that functionality a long time ago already.
And, if you were sneaky you could find out where someone was chatting to by sending the answer back see and if you didn't like the computer center system programmer you could send a wall(1) with it and crash the Gandalf terminal server.
Many VTxx emulators still have this answerback function. Look in the PuTTY configuration under Terminal, "Answerback to ^E" (^E = ENQ).
But what does the RUB key do?
RUB. When the RUB (rubout) key is typed while holding down the SHIFT key, a non-displayable rubout code (ASCII DEL) is transmitted to the computer. The cursor is not advanced and the character code stored in display memory is not overwritten. RUB is normally used to tell the computer that a previous character should be deleted. https://amaus.net/static/S100/learSiegler/terminal/Lear%20Si...
A genie appears who will grant you three wishes.
RUBOUT punched all the bits on punched paper tape. You could use it to actually edit the tape by feeding the tape back into the punch, if you created slack space with some NULs, which didn't punch any holes at all. RUBOUT the characters you didn't want, and punch the replacements into the NUL spaces.

Important to remember that ASR-33s weren't designed to be use with computers.

A colleague had this to say:

I remember a spate of answerback hacks with vt100s. the remote host could program the message by sending an escape sequence, and then get the vt100 to type the string back. you could make the tty execute commands that would give the attacker privs, and stuff like that. The main fix was hardening mail clients to filter escape sequences; simpler days to be sure, but the basic flaw (non-filtered text) still occurs in html forms

I noticed there are some commonalities between this keyboard and the Japanese layout on PC keyboards.

For instance, note the co-location of * and : characters on the same key. It's not in the same place on the Japanese layout, but the co-location is the same.

Another shared feature between the two is the co-location of the = and - (equals and dash).

Next, the tilde in the general same area on the Japanese layout as on this terminal, close to the Return key.

Lastly, the correlation between the numeric row keys and their Shift glyphs is almost the same on the Japanse layout and this terminal!

           1 2 3 4 5 6 7 8 9 0
   JPN-PC: ! " # $ % & ' ( ) <blank>  __ same!
   ADM-DA: ! " # $ % & ' ( ) <blank>
   US-101: ! @ # $ % ^ & * ( )
There may be other similarities; this is just what I noticed at a glance.
FWIW, I just noticed that the Commodore 64 keyboard used the same numeric row layout as ASM-DA and the Japanese layout. Common legacy.
ASCII:

  0x2n:  <blank>  ! " # $ % & ' ( )  * +  , - . /
  0x3n:        0  1 2 3 4 5 6 7 8 9  : ;  < = > ?
Look familiar? This is called a bit-paired keyboard¹ — every pair (or triple, in the case of control characters) of characters on a key differ in encoding by flipping one bit, which is relatively easy to do in hardware. The ADM-3A had no processor.

¹ https://en.wikipedia.org/wiki/Bit-paired_keyboard