10

It had long been my impression that while brackets [ and ] could be displayed by the Apple II, the standard Apple II keyboard was not capable of generating them.

Some time ago I noticed that on this page there is a photo of what appears to be a) a standard U.S. Apple II keyboard, and b) some variant of it that has the REPT key replaced with a ^  ] key, i.e., ^ and, when shifted, ]. (The lower keyboard also has a CAPS LOCK key; I am suspecting that it may be either a modified Apple keyboard or a third-party keyboard.)

Nightfall Crew's Apple II keyboards

More recently, I read on apple2history.org's page The Apple II that:

An unmarked special character was the right square bracket, “]”, accessed by pressing SHIFT-M.

This is in addition to the keys with marked "special" characters, N  ^ and P  @.

Note that the second keyboard in the picture above includes all of these, but in different positions; N and M have no markings for a shifted symbol (perhaps because they are now needed for lower and upper case versions of N and P?) and the symbols are now on 0  @ and ^  ].

So, my questions about this:

  1. Can the ] character really be generated on all unmodified Apple II (and Apple II+) keyboards with Shift-M?
  2. Are there any other "hidden" characters like this?
  3. For keyboards with the popular mod that connected SHIFT to joystick button 2, could you still type ^, @ and ]? How did they handle this?

If you have further information related to those characters or additional characters on non-U.S. Apple keyboards, popular keyboard modifications, or the second keyboard in the photograph above, I'd be interested in hearing about that, too.

Also, rather than a point-by-tiny-point breakdown of questions and answers, I'd prefer to see a wholistic explanation designed to answer all the small questions along the route it takes to putting everything in proper persepective. That is, treat your answer as "here is how you understand Apple II keboards as a whole," rather than "here are some specific points that assume you already have a good understanding of the general design of Apple II keyboards."

10

(It is assumed that this question is about the II or II+, not any later or third party model)

TL;DR:

Can the ] character really be generated on all unmodified Apple II (and Apple II+) keyboards with Shift-M?

Yes.

Are there any other "hidden" characters like this?

Straight away no, but the original II and very early II+ keyboards (with MM5740 encoder) could generate _, [ and \ with 'phantom' key combinations by pressing 4 keys at a time (usually also producing unwanted characters as well).

For keyboards with the popular mod that connected SHIFT to joystick button 2, could you still type ^, @ and ]? How did they handle this?

The II/II+ Shift-Key Modification does not modify the workings of the keyboard, but allows software to detect if the shift key is pressed (*1). It is complete up to each software how to handle this, including what way they offer to access them.

If you have further information related to those characters or additional characters on non-U.S. Apple keyboards,

All original Apple II/II+ keyboards follow that scheme (*2). There is no way around.

popular keyboard modifications,

Popular is one of these bungee words ... The Shift-Key mod has been so popular that Apple had to recognize it - and make it an optional part of the IIe design.

or the second keyboard in the photograph above,

Both shown keyboards are not Apple II keyboards but third party developments.

I'd be interested in hearing about that, too.

Apple II and keyboards are a way too broad issue for a single question. As an Apple II+ user I had already 4 different keyboards over the years (the last being fully programmable with a 65xx running faster than the Apple itself :)). The number of after market keyboards and even more clone keyboards is huge.


In Detail:

(AKA: Everthing you never wanted to know about Apple Keyboards)


Insert: Apple II Keyboard history:

  • The very first would be the Datanetics (a NS MM5740/AAE based ASR33 type parallel keyboard), recomended for the Apple 1 and bare bone Apple II. The encoder chip sits at the top, a PCB cable connector at the top left. It got three additional black keys, B located right of right arrow and C and R located left and right of the space bar.

  • Followed by the first Apple version, used in early Apple II, basically a clone of the Datanetics. The MM5740 now sits at the top left. The parallel PCB contacts moved to the left and are no longer carved out, the DIL socked is added to the right. The PCB got a slot carved between keyboard and encoder - maybe prepared for break away for a planned separate mounting, like with the later II+.

  • Next is the revised version, used in later II and early II+. Here the encoder is no longer 'break away' but integrated beside the Keyboard, the MM5740 sits all the way to the lower left and mounted horizontal. Somewhen around the transition to II+ the power lamp 'key' cap was replaced with a flat lamp cover. There are examples of both machines with either.

  • The third in series is the most common Apple II+ board with a separate encoder mounted on a single row pin header below the keyboard. It no longer uses the National Semi MM5740 but a General Instrument AY-5-3600 or a compatible Standard Micro Systems KR3600, mask programmed for use in the Apple.


Keyboard Decoding

Now, for the encoding: The NS MM5740/AAE is a standard variant for teletypes, producing only uppercase letters, numerals and control codes plus a few symbols. For some letters there are multiple positions, offering the ability to get different results when shifted. This effectively allows to produce all 7-bit ASCII characters - if intended. On MM5740 based Apple II keyboards this feature was used to add additional characters for all shifted digits, plus SHIFT+P for @, SHIFT+N for ^ andSHIFT+M for ] are used (*3). @ and ^ were as well printed on the key caps. By basic design, all others are not wired and thus can't be used ... except:

The MM5740 can be used in 2-key-rollover or n-key-rollover mode (*4). When used as 2-key, like in the Apple, pressing more than two keys may produce 'phantom characters' (*5) by connecting multiple rows and make the chip see keys pressed at positions that aren't wired up at all. The following combinations produce usable characters (*6):

  • SHIFT+U+I+Y for _ (Underscore)
  • SHIFT+U+I+J for [ (Left Square Bracket)
  • SHIFT+U+I+H for \ (Backslash)

Wiring wise this works by having U and I connecting two scan columns making the third letter appear in both columns, while SHIFT selects shifting for this. For the Apple II this means that Y/J/H which all reside in the same column as U now are mirrored into non populated places of the column of I, namely O, K and L, but this time the versions with _, [ and \ assigned when shifted (*7).

Of course pressing 3 characters at once isn't exactly how the keyboard is supposed to work, so hitting them will, more often than not, produce additional, intermediate characters as well. But that's what editing is for :))

The later II+ keyboard, based on the AY-5-3600 is mask programmed for the Apple II and only emulate the 'official' keys (including ]). It moves all encoding variations into the custom ROM, making the key matrix simply filled up with all points used and no redundancy. So no more phantom keys anymore :(

Shift-Key Modification


Insert: Lower Case and Shift on the unmodified Apple 2

The Basic II/II+ did neither support entering nor displaying lower case characters (*8), so programs had to come up with ways to circumvent this. Apple Writer may be the most prominent example. They set the lead for many others.

For output simply all lower case was displayed as normal text (upper case) letters, while upper case was shown by inverting it. Of course, as soon as there was a 80 column card used, lower case were possible.

For Input the ESC key was used. Pressing it once marked the next character to be entered as upper case. This of course disabled cursor movement, as this was based on escape sequences as well (*9). Thus pressing Escape twice let the next character entered work as escape sequence. It truly created a new style of typing and a learning curve (*10).

To support editing the cursor could take 3 shapes:

  • (White block) for lower case
  • + (Plus) for upper case
  • ^ (Caret) for cursor movement.

This lead to the result that SHIFT+M sill produced a ] while ESC SHIFT+M gave a } - displayed as inverse ]. The corresponding opening brackets had to be entered as CTRL+N and ESC CTRL+N, while SHIFT+N produced ~ (Tilde), displayed as ^ and ESC SHIFT+N gave ^displayed as inverse ^. Similar for @(SHIFT+P) to give Backtick and At. Complicated? Of course all of this could display complete different on a printer ... not to mention when used with a different language setup :)


The Shift-Key mod is done by pulling a wire from the shift signal pin the keyboard PCB to Push Button 2 (the third) of the game connector. Since usually done by wire clips it's non intrusive and easy removable. It did not change or modify the keyboard behaviour at all. Programs reading (direct from $C000 or by using RDKEY) will still get the same char as without the modification. Unless an application active detects the shift key, nothing is changed.

Detection is fully done in application software and not supported by either ROM. Whenever a program detects a key press, it will get the key as usual (*11) and may now check for PB2 at $C063. If set, shift is pressed - at the time the read happenes, which may be way later than the keypress, depending on program load. Thus it may have been already released, or pressed for the next character to be typed. Fast typers (or users of slow software) thus may experience missing capitalization or capitalization of a previous character.

The mod was so popular (and some software really depending on it), that Apple did include a broken bridge on the IIe motherboard, which, when closed, would connect the shift key(s) again to PB2.

Adapting a program for the mod added a serious problem for shifted letters with Symbols (P/N/M). Now a user rightfully expects pressing SHIFT+M to bring up an upper case M - no more room to ESC/SHIFT/CTRL/whatsoever them as before.

Solutions to bring back symbols were of course again program specific. In case of Apple Writer they abused its glossary feature. It allowed to assign for each typable character a phrase. These phrases would be inserted when typing CTRL+G followed by that character. A premade file assigning special characters was provided:

  • CTRL+G b -> \
  • CTRL+G c -> ^
  • CTRL+G t -> ~
  • CTRL+G u -> _
  • CTRL+G c -> |
  • CTRL+G < -> [
  • CTRL+G > -> ]
  • CTRL+G ( -> {
  • CTRL+G ) -> }

(Yes, another steep learning curve)

Of course, this was only Apple Writer. Other programs tried other ways.


*1 - Hopefully that is, as the shift key may have already been released when the program reads the button input, due to load and the buffering nature of the keyboard port.

*2 - I may have to check my IIj+, but I'm pretty sure it doesn't have any different wiring .

*3 - It remains a mystery why that feature hasn't been used for all letter keys with optional shifted symbols (like K/L/O).

*4 - Key-rollover describes how many keys can be pressed simultaneous and still detected.

*5 - It works somewhat like the 'illegal' opcodes on the 6502, as unplanned connections are done.

*6 - Other three key combinations will as well produce 'strange' characters, but AFAIR no useful at all.

*7 - The MM5740 is meant to handle ASR33 type keyboards, thus the assignment is exactly like on a real ASR33, wheere SHIFT-K/L/M produces [/\/]

*8 - Another sign how little thought was given to now ubiquitous text editing back then.

*9 - Same I/J/K/M as with the ROM

*10 - With the Shift-Key modification installed and Apple writer II this behaviour could be ignored ... resulting in a quite annoying phase of unlearning hitting ESC for every upper case letter and in front of every escape sequence. Of course now special characters work again different as well :)

*11 - M encoded as $CD (M), SHIFT+M as $DD (]). All with high bit set, as that's the key pressed indicator.

  • So to be clear, only the older keyboards could do ] on Shift-M? Any thoughts on why Apple chose not to provide [ and `, and hide or remove ]`, when having them all seems so easy to do? – Curt J. Sampson Oct 8 at 9:11
  • No, the seperate encoder one (new II+) can do Shift-M as well, it can do everything the old officially did. Just not the shift-U-I-kombinations. And no, having them wouldn't be easy. Such multi key combinations would only work with a diode equipped keyboard and a specific modified encoder. They did go for plain compatibility of the official abilities - I, as II+ user, wouldn't have mind if the other keys as well would get shifted symbols. – Raffzahn Oct 8 at 9:18
  • If you could edit your post to clarify that the "hidden" (i.e. unmarked) yet "official" ] is also produced by the AY-5-3600 version, that would be great. – Curt J. Sampson Oct 8 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.