I hate to disappoint you, but there is much easier way to have a decent on-screen keyboard in XTerm. Simply overlay it over entire screen: as XTerm itself rarely requires mouse input, you can just as well use the whole screen as a virtual keyboard. PS: In fact, this modification has already been applied to the current Diablo XTerm, quite successfully.