Same hereMuirium wrote: ↑Hmm…
I guess so, at least for the converter; I haven't looked at the controller yet (don't need that).Muirium wrote: ↑Arakula: reckon you've learned enough that you could write your own, distinct, equivalent of Soarer's converter and controller?
I was going to anyway. Long story follows ...
Because, you see - Soarer's Converter simply doesn't work for me.
Basically, it does what it should do - convert my Model M-122 terminal keyboards to USB - but it doesn't work with a KVM switch I have to use @office. Instant belly-up - the KVM switch won't transmit a single mouse or keyboard event until Soarer's is unplugged again, and with a bit of bad luck I have to reset it, too. That's why I started to recreate the source code - to get my wonderful big keyboard working on that KVM switch.
Playing with tmk as an alternative, I found out that the KVM switch absolutely HATES this NKRO stuff; if I configure the ps2_usb project in tmk to use the "normal", boot-compatible method without NKRO, it works with the switch. Unfortunately, tmk_keyboard is not exactly easy to understand or modify, and the idea of compiling a new firmware to change the layout isn't really as appealing as the EEPROM-based configuration used by Soarer.
So, since talking to Soarer obviously is impossible, I set out to get Soarer's Converter to do what I want. As a nice and educating exercise, I reverse-engineered it, then tried to modify it so that it works with the ***censored*** KVM switch.
Turns out that isn't so easy. While Soarer's Converter still contains the boot-compatible keyboard code, he deliberately crippled the HID descriptor for it, so only the NKRO stuff is really used for communication with the PC. OK, so I added the HID descriptor stuff ... compiled, reflashed, and ... haha. Now it sent all keys twice. Once for the boot device, once for the NKRO device. To me, it looks like he didn't add code to determine which interface the computer really uses, and I'm not versed enough in the matter to correct that (please keep in mind that I soldered my first Teensy into a terminal keyboard about 5 months ago; that was my first exposure to an ATmega32u4). So, next step: remove the NKRO device. Hmmmm, much better. When attached directly to a PC, this works just nicely, and would be exactly what I need.
But not with that blasted KVM switch. If I attach Soarer's Converter with boot HID configuration to that, it passes on the keys - YAY! - but for each key, it also moves the mouse pointer. There's a USB mouse attached to the KVM switch as well, and obviously Soarer's Converter does the USB communication in a way that causes the KVM switch to replay the last mouse movement whenever a key press or release is reported. To find out whether this is a bug in Soarer's Converter, I played with the code example from PJRC that obviously was one of the original cornerstones that Soarer's Converter was built on. And, guess what - this exhibits the same behaviour. I've asked for guidance in the PJRC forum, but never got an answer.
The LUFA-based tmk_keyboard code, however, does not exhibit this weird behaviour, which seems to indicate that the PJRC code causes the problem. The two approaches (PJRC and LUFA as used in tmk_keyboard) are vastly different, making a comparison extremely difficult; I couldn't find out in a reasonable amount of time what exactly makes the one work correctly, but not the other.
So I'd rather use the ps2_usb project in tmk_keyboard as a base and add EEPROM-based configurability to that.