Moose512 wrote:I know the title doesn't do a great job, but here's the situation:
I have a physical push button connected to my Raspberry Pi's GPIO pin 18.
I wrote a script that, when receiving button input, outputs the keystroke W.
Script runs great on Raspberry Pi, no problems there.
Now, here's the rub:
The goal is to have a switch that, when pressed, activates a button in a computer game on my windows machine. My motherboard doesn't have an RS-232 port and I don't understand how USB works enough, so I'm using the Pi as the button interface. I want to take that W keystroke from the Pi and make my Windows computer execute that command.
Anyone able to point me in the right direction? I may post pictures and diagrams tomorrow. Too tired tonight,
P.S. Both computers are network connected and I SSH through PuTTY.
There are a number of approaches, possibly not all that trivial, but it seems to me you are going to need an executable running on the Windows machine that is listening for a response from the Pi and then uses something like SendKeys() to the Windows app.
At the most basic level, you could have the Pi write a file to a share on the Windows machine, that your listening app monitors for the creation of a file; crude, kludgy, bit it will probably work.
You could use a sockets based approach, potentially more reliable, but not as easy to code.
SendKeys
You would need to ensure that your game window has focus before calling sendkeys, which probably means using the old FindWindow call
http://stackoverflow.com/questions/2817 ... ons-window
Of course you don't have to use C# and this is not a particularly elegant approach, but needs must when the devil drives
Joe