reenigne
Veteran Member
I'm writing a little Arduino program to simulate a PC/XT keyboard, so that I can have a PC or XT on my workbench as well as a modern PC and control the former with the latter (and so that I don't have to devote space to two keyboards). This program will have several modes. In one mode it'll just take scancodes from the serial port and output them to the keyboard port (and I'll probably write a little program for the modern PC to act as a "virtual PC/XT keyboard").
I thought it might also come in handy to also have an ASCII mode, so that you can just use a standard serial terminal (physical or virtual) as a PC/XT keyboard - when you send an ASCII character over the serial link the Arduino program will convert it to a sequence of press and release scancodes to type that character.
Which brings me to my question - if I were to add to this ASCII mode capability to send codes corresponding to cursor movement keys (Up, Down, Left, Right, Home, End, PgUp, PgDn), function keys (F1-F10), other keys (Esc, PrtSc, Del etc.) and possibly even keystrokes modified by combinations of Shift, Ctrl and Alt, what protocol should I use? Excluding Enter, Backspace and Tab (which seem to be mostly standard), there seem to be lots of different standards to choose from. PuTTY seems to have at least 6 (ESC[n~, Linux, Xterm R6, VT400, VT100+ and SCO) plus standard or rxvt for Home and End. What's your favourite and why (and where can I find a list of keys and corresponding byte sequences for it)? I'd be especially interested to hear from you if you'd have a use for this program when it's finished (e.g. if you have a 5150 and a VT100 gathering dust in your basement and you'd like to be able to connect them together).
If you're interested I'm putting the code for this online here. As well as sending keystrokes to the PC/XT I'm also experimenting with sending data back (the clock line can be pulled low by clearing bit 6 of port 0x61) so that with suitable software on both machines, I can write programs on the modern PC, download them to the PC/XT, run them and get results back all over the keyboard port (so no expansion cards necessary!). One other fun little feature that I'm planning - as well as pretending to be a keyboard, it'll also be able to pretend to be the little doodad that IBM used to plug into the keyboard port for manufacturing tests - if the BIOS detects the presence of this device it downloads a program from it into RAM and executes it early in the boot sequence. This is one way it'll be able to run programs on the PC/XT - I'm also planning to teach it to type in machine code programs via the BASIC interpreter or via DEBUG, so there's several ways it can bootstrap itself.
I thought it might also come in handy to also have an ASCII mode, so that you can just use a standard serial terminal (physical or virtual) as a PC/XT keyboard - when you send an ASCII character over the serial link the Arduino program will convert it to a sequence of press and release scancodes to type that character.
Which brings me to my question - if I were to add to this ASCII mode capability to send codes corresponding to cursor movement keys (Up, Down, Left, Right, Home, End, PgUp, PgDn), function keys (F1-F10), other keys (Esc, PrtSc, Del etc.) and possibly even keystrokes modified by combinations of Shift, Ctrl and Alt, what protocol should I use? Excluding Enter, Backspace and Tab (which seem to be mostly standard), there seem to be lots of different standards to choose from. PuTTY seems to have at least 6 (ESC[n~, Linux, Xterm R6, VT400, VT100+ and SCO) plus standard or rxvt for Home and End. What's your favourite and why (and where can I find a list of keys and corresponding byte sequences for it)? I'd be especially interested to hear from you if you'd have a use for this program when it's finished (e.g. if you have a 5150 and a VT100 gathering dust in your basement and you'd like to be able to connect them together).
If you're interested I'm putting the code for this online here. As well as sending keystrokes to the PC/XT I'm also experimenting with sending data back (the clock line can be pulled low by clearing bit 6 of port 0x61) so that with suitable software on both machines, I can write programs on the modern PC, download them to the PC/XT, run them and get results back all over the keyboard port (so no expansion cards necessary!). One other fun little feature that I'm planning - as well as pretending to be a keyboard, it'll also be able to pretend to be the little doodad that IBM used to plug into the keyboard port for manufacturing tests - if the BIOS detects the presence of this device it downloads a program from it into RAM and executes it early in the boot sequence. This is one way it'll be able to run programs on the PC/XT - I'm also planning to teach it to type in machine code programs via the BASIC interpreter or via DEBUG, so there's several ways it can bootstrap itself.