0

I'm trying to send input from an AutoIt script to a game. I used Spy++ and when I press W it receives:

messages received by the game image

But when I use Send("w") or any other method that simulates input (ControlSend(), MouseClick(), ControlClick()) it receives nothing. I also tried SendMessage, PostMessage and SendInput in C#.

I tried it on Notepad and Chrome and that worked just fine. Could the developers block these methods so the game doesn't receive the events?

user4157124
  • 2,809
  • 13
  • 27
  • 42
laurGanta
  • 175
  • 1
  • 1
  • 12
  • 1
    `blocking` might be the wrong word. Some games (and obviously `Spy++` too) implement an own keyboard scanning. So there is no entry point for `send` etc. – Stephan Nov 01 '17 at 11:51
  • I assumed that if Spy++ shows the messages received by the process when I use the keyboard, it means that the process uses the input received from PostMessage/ SendMessage/ SendInput etc. It makes sense anyway, that even if the process receives these messages, they might actually be ignored and it uses some sort of keyboard scanning. I still don't understand why Spy++ doesn't pick up the messages when I send controls from AutoIt, but it does pick them up when I send them to Notepad/ Chrome. – laurGanta Nov 02 '17 at 09:32
  • When Spy++ doesn't pick up messages, maybe there indeed is no communication (which nees a sender *and* a receiver - no receiver, no communication, no matter how much the sender is sending). – Stephan Nov 02 '17 at 13:33
  • Did you try changing the SendKeyDownDelay and SendKeyDelay options from their defaults of 5ms? Often this is too short for games. Experiment with larger values like 200+. – garbb Nov 21 '17 at 17:52

0 Answers0