I'm currently studying socket programming, i'm working on creating an application to use my phone as a wireless keyboard/mouse. My current approach is to have the phone app send messages over wi-fi to an application on the computer which will translate those message to keystrokes, mouse movement, and mouse clicks.
The communication part is not the problem, the problem is once the message gets to the application on the computer, i'm not sure how to turned em into keyboard input/mouse input. I did some research and i found a few examples, but most of them required me to select an application to send the input to. Is there a way to just send the input to whatever the current application is? Also most of the examples i saw where for windows only, and i want my application to work in linux, macOS, and windows.
Do you guys have any suggestion on what i could use? or can you point me in the right direction to better research this.
I'm currently using C++ for the application
For Linux, I suggest you inject events into the kernel event subsystem. Look here: http://thiemonge.org/getting-started-with-uinput, specifically in the section "Injecting events in the input subsystem".