A few years ago I picked up an empty QL case (I have no idea why it had been separated from its contents).
I got thinking that it would be interesting to use it to house a Raspberry Pi running a QL Emulator, but obviously that would only be interesting if the keyboard worked. So I spent some time looking at writing USB keyboard interfaces for Arduinos or other microcontrollers.
However, I then stumbled on the Teensy board, which is an Arduino compatible(ish) board, but the reason it interested me was because it had a library to support USB keyboard interface. It also supports the keyboard interface over the same USB port that it's programmed through, which I believe isn't possible on most Arduinos. Aside from being convenient, this saves a couple of IO pins.
The project evolved very slowly. At first, I couldn't get hold of proper QL keyboard connectors, so I was trying to use a Spectrum edge connector, which sort of worked with an extra piece of plastic to give the correct thickness, but aligning the connectors was a pain. Then I came across RWAP Software, who sold me the last set of connectors they had.
I did some initial prototyping on a breadboard, but as the result was going to be too thick to fit inside the case, I moved on to prototype board. Here's is what I ended up with:
It's about as simple as it could be, with one set of output pins connected to the keyboard pins through diodes, and the inputs connected directly to the columns.
The software scans each keyboard row in turn and keeps an internal map of which keys are pressed, as well as up to six concurrently pressed keys (though in practice, pressing more than two keys at once doesn't really work on the QL keyboard).
It also detects combos like CTRL+LEFT and converts them into PC keys like Backspace.
At present I've set up the following combinations:
- CTRL LEFT = BACKSPACE
- CTRL RIGHT = DELETE
- ALT LEFT = HOME
- ALT RIGHT = END
- ALT UP = PAGE UP
- ALT DOWN = PAGE DOWN
- CTRL ALT RIGHT = CTRL ALT DEL
- ALT F5 = SUPER (Windows) Key
- ALT \ = PRINT SCREEN
- ALT 4 = RIGHT-ALT 4 - Euro sign on UK Keyboard
- ALT A E I O U = RIGHT-ALT A E I O U - This is useful to me for Irish keyboard layout, but probably not much for anyone who doesn't write in Irish.
https://github.com/lostcarpark/ql_keyboard
Edit: Forgot to mention I've written this post with it. It's fun typing on a PC with a QL keyboard, though I'm not quite ready to use it as my daily driver keyboard.