Keyboard/Mouse/Joystick or Serial/Keyboard/Mouse/Joystick should both work...if the KVM were doing the right thing (and I haven't screwed up something stupid in the code).
I'm running out of ideas for this
. It's sounding a lot like the KVM isn't properly reading the keyboard data reports (despite them being the normal standard "bios-mode" USB keyboard report). Is it at least passing the data through to the currently-connected computer?
If you change the programming so that it sends a normal keypress (e.g. send KEY_A twice instead of sending KEY_SCROLL_LOCK twice), and then open a text document, does the computer type that letter twice into the document when you make the touch connection while the teensy is plugged into the keyboard port of the KVM? Does it type that letter twice when the teensy is plugged directly into one of the computer's usb ports (not through the kvm)? If they both type the double-a, then I'm at a total loss - it would mean (if I've read the manual/faqs for that kvm switch right) that the kvm understood the teensy usb keyboard presses well enough to emulate them but not to actually respond to them (wtf?). If the computer typed the a, but the kvm didn't, then the kvm is probably not recognising the teensy USB keyboard at all. If neither typed it, then there's a problem with the actual sending code so that the keypresses are not actually being sent.
If it's working through the computer but not through the kvm, the last thing I can think of to try is more difficult - it would be to change the teensy hardware-library code so that it *only* reported the Keyboard USB HID interface (in case it was the presence of the mouse/joystick interfaces that is causing the KVM's emulation to go wacky), and not the mouse/joystick/(Serial) interfaces. Paul is probably a *much* better person to describe how to cut that down properly - there's a lot of stuff in there, and if you get it wrong the computer won't recognise the teensy when you boot your code (though you can at least get it back into reprogram mode by holding down the reset button on the teensy while plugging it into the computer if that happens).