An APL Keyboard for the Next Generation

by Adrian Smith (adrian@apl385.com)

Abstract

The positioning of the APL symbols on the physical keytops has been a progression of historical accidents, which has left us with a layout that is far from mnemonic for new users. The default layouts supplied by APL2000 and Dyalog cannot be used in other applications (such as Word or Outlook) because of conflicting demands on either the Alt or Ctrl keys. This note suggests a radical rethink along the lines proposed by Adin Falkoff, but taking account of modern Windows conventions and internationalisation issues.

Objectives

The main goal is to add an entry to the standard Language Bar that offers an APL keyboard as a choice, so that it is possible for anyone to type APL characters directly into Word (or Notepad) without resorting to pasting characters from Charmap. This layout should be sufficiently unobtrusive that it can simply be set as the Windows default and forgotten. Ideally it will be easy to implement for languages other than English – this constrains it to avoiding the AltGr settings for the number line (as far as possible) as many languages (such as German) require these keys for common punctuation symbols like \ and {}.

A secondary goal is to make it possible for students to take advantage of the free interpreters now on offer from Dyalog and Richard Smith. Rowan has already adopted the provisional layout outlined in this paper, and it is a fairly mundane task to build DIN files for Dyalog APL and a similar layout for Ascii-mapped APLs like APL2000.

Basic Rationale

Here I am following Adin Falkoff in trying to forget the past (which was largely based on the physical constraints imposed by the original Selectric golfball) and make a reasonable mental link between the APL symbols and what appears on the keytops. This leads us to a simple hierarchy of placement rules:

  1. If it appears on a key, just use that key.
  2. If there is a clear visual association, then choose that next. If the APL symbol is simply the engraved symbol with something added (for example ≤ is just < with an underbar added) that makes a very strong case.
  3. If there is a reasonable mnemonic for the symbol name (say T for Times) these should go next. Clearly this is language-dependent, but most of our target users probably speak English.
  4. The rest will just have to fall where they may, but we should try to get the commoner ones on the easiest keys to hit.

We cannot use the normal left-Alt key (reserved by Windows) and we should not use the bare Ctrl key, as combinations like Ctrl+C and Ctrl+S are now quite universal in Windows applications. That leaves right-Alt (Alt+Gr in Europe) or Ctrl+Alt on the rare keyboards which don’t have a right-hand Alt key, with AltGr+Shift as the only available targets. Where possible we should avoid the number line as AltGr+4 is already standard for the € symbol, and many other such combinations are heavily used throughout Europe.

Implementation

The Microsoft Keyboard Layout Creator is a very easy-to-use freely available tool, which lets you assign characters to various key combinations, then saves the layout as an installable file (as well as in a simple text format). The pictures shown below were screen snaps taken in the AltGr and AltGr+Shift states.

You are welcome to try this out by downloading the UK installer, unzipping it to a temporary folder and running the installer. Then go to Regional Settings, choose the Languages tab, and hit Details. You will then be able to Add the new keyboard for your chosen input language. To get rid of it, first come back here and delete it, then use Add/Remove programs to de-install it completely. It should be quite safe to set it as your default layout, as it will not touch any of the keys you normally use in the vast majority of Windows applications. Finnish users can try out the Finnish installer and APL2000 users might like to experiment with an Ascii-mapped installer instead!

So let’s start by walking around the common APL symbols, and the keytops they have landed on:

The Shifted keys generally try to pair up the symbol from the base key – in an obvious way like Find on shifted Epsilon, or as the other half of a pairing like Ceiling on Shift+Floor.

Of course there are plenty of stragglers and a fair number of new entrants (like Square root and Summation) which I need for Rowan or APLNext. I really don’t care much about where these go, as Rowan has a nice ‘symbol pad’ in its left sidebar that means I can always go pecking with the mouse for the ones I can’t remember. This may change a little for the US-English layout (Rowan’s Customise got where it is because it looks like @ which hangs out here in the UK) and quite a bit in Europe, but I think it stands a chance of working reasonably almost everywhere except Russia and Japan.

Now all I need to do is set it as my Dyalog DIN layout and see how long it takes me to learn it! The above ZIP includes a first attempt at this, and puts Copy/Paste and friends where everyone else has them.

For Traditionalists Only

Although Caps Lock normally just does what it says, some national keyboards (such as Swiss-German) use it to switch to a completely different layout. This effectively opens up another 55 keystrokes, which are more than enough to drive anyone wild. Here is an idea that might suit some APL old-timers:

The two layouts show what happens when you hit Caps Lock – this simply models the two layouts available on the original Selectric terminal with the APL golfball installed! Of course you will still need AltGr to get at things like Reverse, as there is no way to create arbitrary overstrikes in a keyboard table. I don’t think I can do this with ‘dead keys’ as I would need far too many of them to be sensible. Match and NotMatch replace the left and right tacks, as per the Dyalog ‘combo’ layouts but the rest of it is a straight crib from the picture in my original Gilman and Rose circa 1982.

References

[1] Smith, Adrian, The Falkoff Dual Keyboard, Vol 6.4, 92