I've run into an odd problem with AutoIT's ControlSend function on Windows 7, so I'm hoping someone can help.
I've written FUSE filesystem, which is shared with Windows via Samba. I'm trying to automate tests of the filesystem on Windows using AutoIT to write and modify files on the filesystem with a variety of different applications.
When I first kicked off the tests I was using the "Send" method to send keystrokes, but I found that other applications would occasionally steal focus and my tests would grind to a hault. I hoped that using ControlSend would allow my tests to proceed even if focus was stolen. The problem I'm running into is that sometimes modifier keys (like Shift and Control) aren't sent as they should be.
For example, if I use
ControlSend("Open", "", "Edit1", "Z:\test.txt")
to set the path in an open dialog, I will occasionally see the text come across as "z;|test.txt", apparently having inverted the shift key for a few characters.
In another case, if I send
ControlSend($hWnd, "", "Edit1", "^o")
To send "Ctrl+o" to a Notepad Window, I will occasionally find that instead of bringing up the Open dialog, AutoIT simply types the letter "o" into the Notepad text field.
I need to be able to set up these scripts and let them run for continued periods unmonitored, so having it occasionally type characters that are explicitly not what it was supposed to send make it an unworkable solution.
Is there something I can do to make it more consistent about sending the right characters with the right modifiers?