I am developing a C# application that gives the user the possibility to set some specific keystrokes that the applications will reproduce when it will be launched in execution. As far as I was testing my application in notepads or other simple programs it worked just using SendInput
or InputSimulator
, but as soon as I tried it with a video-game the emulated input could not be received by the game.
The strange thing is that actually the input is received by the game but only if I am using the game chat.
To be clearer I will make an example:
I set in my application to reproduce the key w.
I launch my application and then I launch a FPS game like CounterStrike.
When the applications emulates the pression of the w key my character in the game doesn't move! But if i click on the chat and try to write something in the chatbox the emulated input is recognized and I can see the "w"
s being written in the chatbox.