0

Say you are at work, you ssh to your home PC and opened a python game.py. No VNC. Is it possible to press down and up, space, etc. inside the window of the game? No need to see the actual game graphics, I'm just prototyping something, just want to be able to send inputs to the game using ssh.

The task should require nothing more than SSH because I'm connecting with android.

  • 1
    Is that game.py a X11 application? What X server is it connecting to? See xdotool to send key events to a X windows. Or is it a terminal application? – Stéphane Chazelas Aug 20 '15 at 9:05
  • @StéphaneChazelas it's a pyglet game, not cli, i don't know what xserver is connecting to right now – Lynob Aug 20 '15 at 9:47
  • The X server it's connecting to would be the one where it's displayed on. If you run the ssh client in a X Window terminal emulator with the -X or -Y option. Then, $DISPLAY on the remote machine will point to sshd's proxy connection to your X server and your game will be displayed here, not there (and you could send keyboard events from here). If you don't use -X or -Y, then that game.py won't be aware of any X server to connect to so should fail. – Stéphane Chazelas Aug 20 '15 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.