Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Two programs to recieve keyboard input simultaneously?

  1. May 6, 2015 #1

    A tough one here. Does anyone know a way to control 2 or more programs simultaneously? i.e. give focus to two programs?

    My brother wants to control two games (full screen), on the same PC, at once, I assume that he only needs one to be maximized at a time, but the trouble is giving focus to one will cut the keyboard off from the other, Any way he can make this work?
  2. jcsd
  3. May 6, 2015 #2


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

  4. May 6, 2015 #3
    From within one program, you can open another one as a file descriptor and read and write to it.

    #include <cstdio> //<stdio.h> in C
    FILE * fp = popen("yoursecondprogram --withargs", "w"); //write mode
    if (fp == NULL) exit(1); //ERROR
    fwrite(fp, 6, 1, "hello\r"); //Sends "hello" to the secondary program's stdin.

    This is useful for proxying keyboard input, if you want things like key control for a game or something more real-time reactive, stdin is likely not what you want. You'll have to open up a socket communication between the two programs: The receiving program would have to open up a listening socket and the main program would have to send keyboard statuses through it. I have a similar issue right now where I want two different computers to control one two player game. I need a small helper program on the second computer to send commands over the network.
  5. May 6, 2015 #4
    Hi everyone! I have the same problem!
    I found a program called Cheat Engine, you can use the hotkey option and freeze/pause every game by clicking any key.
    I just have to turn on 2 Cheat Engines and select a hotkey for processes for 2 opened games. When I push the key it freezes two games at the same time, so I think it's possible to control it simultaneously. But there's a problem, There is no option for moving characters in the game, just freezing or changing values. so I have a question is there a program which will let me select a procceses and control games simultaneously? Sorry for my English
  6. May 7, 2015 #5
    For games use ISBoxer. It's purpose built for this.


    It has a lot of features. For example it can chop up the game UI and display all the UIs from all your clients onto a separate screen.

    Here's a guy playing 5 clients at once with ISBoxer


    Edited to change the screenshot. I just remembered that no-one who doesn'tplay Eve understands Eve screenshots ;-)
    Last edited: May 7, 2015
  7. May 8, 2015 #6
    Thanks Carno and everyone who tried to help me. ISBoxer is the solution of my problem.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook