Cubase & keyboard input

This is not a prerogative of Cubase: other hosts, even on mac, behave strangely with keyboard input in plug-ins. The solution I came up with, is to determine what host has loaded the plug-in and, for those that require it, replace the regular TextEditor with a equivalent one, inherited from TextEditor, but that performs an addToDesktop call when it gains the focus, and then adds itself back into its parent component with an addChildComponent when it loses its focus