I can help with part of that. Clicking on a numbered button on your main hasn't got anything to do with transmitting keypresses. The keypresses (however you're doing it, software, hardware...) must be hardware-level events, not UI events in the client.