What controller?
OK a second bit of lateral thinking(s)...
As we now know you are using some sort of controller how about the controller doing a
hard reset, (or maybe a soft reset), to return you back to the command prompt.
Yeah, it takes time to reboot but get something working first then improve on it.
How about strippng a cheap USB KB for its board and using your controller to short
the two pairs of lines and having a real Tab-Q, assuming Tab-Q actually works.
I made a slow I/O port using an old KB, and it might help with the idea, here:-
BerliOS Download - The Open Source Mediator
(It might point you to SourceForge now though.)
Ignore the 8086 Assembly and MikeBASIC code as this was for a specific application.
It is certainly a back door that gave MikeOS a serial I/O at around 50bps...
Apologies to the Moderators for plugging my stuff...