Thanks for testing it!
The adapter doesn't seem to work when first powered on, until you press the reset button. I'm not sure if that's expected. After pressing the reset button, a blue LED labeled LD4 turns on, and the adapter works. But at first power-up, LD4 is off.
I think I've seen that too. It sounds pretty reproducible, I'll take a look.
A few keys on the numeric keypad do unexpected things: The numbers, decimal point, enter key, and the - minus sign work. Num lock does nothing, which is fine. / (forward slash) functions as up arrow. * functions as right arrow, + functions as left arrow.
This should be a simple mapping thing. The docs on the keypad are a bit wonky, but I'll take another look.
I also got into a state where the arrow keys did nothing. But after a reset, they worked again. Another time I got into a state where left arrow would type +, right arrow would type *, up arrow would type slash, and down arrow would type =. I think maybe I got this to happen by holding down the arrow keys until the key repeat action kicked in, but not sure.
Weird. For PS2 keyboards, the keyboard will do the key repeat and repeatedly send a keydown event. For the mac, they don't, the system handles the autorepeat. I attempt to send a command to the PS2 keyboard to disable the key repeat in the keyboard. It could be that command is failing on your particular keyboard. But the keypad stuff is also a little weird in the protocol, so it could be messed up there as well.
I got into a state where Caps Lock turned on the keyboard's indicator LED, and letters typed appeared in all caps. Pressing caps lock a second time turned off the LED, but the keyboard remained in all caps mode. There didn't seem to be any way back to normal mode, expect to reset the board. I tried that test a second time, but couldn't repeat it.
The current behavior is the adapter drives the PS2 keyboard's LED. So when the adapter sees the capslock keydown/keyup, it keeps track of the capslock key state internally and then sends PS2 commands to the keyboard to turn the LED on & off. I originally implemented this behavior when the adapter was pre-ADB only, since pre-ADB keyboards have no LEDs and the protocol has no notion of the computer being able to tell the keyboard to turn them on/off. So the adapter drove the LED state to make it work without OS support.
ADB is a bit of a different story, since the Apple Extended Keyboard introduced the 3 LEDs, and the protocol allows for the computer to turn them on/off. Right now, the adapter does not honor the computer's commands to toggle the LEDs, the command is silently ignored. For the most part this doesn't matter, since what the computer is telling the adapter is what the adapter does anyway (turn capslock led on when capslock is pressed, turn it off when pressed again, etc). However, there's a couple little utilities out there to mess with the LEDs of the keyboard for other purposes. I know of at least 2: one that toggles the LEDs to reflect system activity (disk/floppy/etc), and one that just cycles the LEDs.
My current inclination is to leave the existing behavior, since it usually doesn't matter, and it makes the LEDs work with pre-ADB systems.
It's 4-ways ambiguous which way the adapter board should be connected to the ST discovery board.
Yeah, I should add that to the wiki. The adapter board connects to the bottom of the discovery board (the side with the longer pins), with the PS2 adapters on the same end as the micro USB port on the discovery board.
The board could be made smaller, although for the board shop I'm using, seeed, unless I got it down to a 50cm x 50cm square, it doesn't make any price difference. For price, they come out to about $3 each as-is, and getting down to a 50cm x 50cm square would bring it down to about $1.50 each.
As for the orientation, if the board went on top of the discovery board, the reset button is obscured (not terrible, but hey) and I'm not sure how solid the connection would be between the adapter board and the discovery board, since the pins are shorter. With the current orientation of the adapter board on the bottom, the connectors are too tall to fit between the adapter board and the discovery board, and then the DB9 kinda sticks out anyway. I could experiment with the board being on top.
For the rj11 keyboard connector... As you can see, this board is completely devoid of any electronics. It's purely an adapter board. So far, it's also the most advanced electronics I've done.
For a switch, wouldn't this have to be a 4PDT switch to get it right?
For autodetection, I've gotten several suggestions that are over my head, so... I'm not sure I'm going to get that right.
I'm kind of leading towards just changing it to be telephone handset cord only, and maybe I can get some help on figuring out how to protect the adapter when the computer's 5V is connected to the adapter's ground.