I had strange problems trying to send key strokes to control native IGv3. It was very hit and miss, and one computer worked better than another, even though they supposedly had the same software running. This is in combination with voice control, not sure how things differ with just a button.
First I tried using the RR SENDKEY command combined with ACTIVATE and GETFOCUS, like so:
Code:
ACTIVATE;IGuidance||SENDKEY;{ENTER}||GETFOCUS
This was actually from the sample commands.xml that is provided with the voice control download. This just didn't work for standard keys, like {ENTER}, {SPACE}, "1", "r", etc. However it did work for ALT- combinations. Unfortunately this leaves out getting to the main menu.
Next I tried AutoIt and the send() function. I seemed to get this working on my laptop I'm using for development, but it was occasionally unreliable and I seemed to be able to improve the reliability with sleep() functions in between each command. However on the car computer, (same software) it just didn't work unless I was already focused on the iG window. My code to navigate home looked like this:
Code:
Opt("WinSearchChildren", 1)
Opt("wintitlematchmode", 3)
Sleep(500)
WinActivate("iGuidance")
WinWaitActive("iGuidance")
Sleep(250)
Send("{ENTER}")
Sleep(150)
ControlFocus ( "", "shortcuts", 906 )
Sleep(50)
ControlClick ( "", "", 906 )
Sleep(150)
ControlFocus ( "", "go home", 911 )
Sleep(50)
ControlClick ( "", "", 911)
Finally, I discovered the AutoIt ControlSend() function, which the AutoIt help even says is more reliable. I have to provide it the window name and the control ID in addition to the keys, but it worked like a charm every time. I can't flub it up. I even got rid of all the sleep functions, so now commands execute fast. Here is the new code:
Code:
Opt("WinSearchChildren", 1)
Opt("wintitlematchmode", 3)
WinActivate("iGuidance")
WinWaitActive("iGuidance")
ControlSend("iGuidance", "", 59648, "{ENTER}")
ControlFocus ( "", "shortcuts", 906 )
ControlClick ( "", "", 906 )
ControlFocus ( "", "go home", 911 )
ControlClick ( "", "", 911)
Now I have complete voice control over my native iGuidance. Just wanted to share in case others were having trouble with this.
Bookmarks