Updated example. It now sends key press to server