I copied the AutoHotkey script from orbiterwiki.org. The script wasn't working for me as is, but I was able to change it so that it does work. However, every time I run the script, the two External MFD's come up just fine, but when the script exits, my computer acts as though the Control key is being held down. I've found that simply tapping the control key 1 time will make my computer let go of the control key, but I'd like to figure out what the problem is because every time I run the script, I have to remember to press my control key afterwards or else all sorts of weird things happen.
Weird things like, if you scroll your mouse wheel while inside of an app, it thinks you are CTRL+scrolling ... which often resizes the text. Or if you press an arrow key, it thinks you are pressing CTRL+arrow key.
Here is my version of the script.
Note that I had to replace Send ^{F4} with
Send {LCtrl down } ;
Send {F4} ;
Send {LCtrl up } ;
For whatever reason, Send ^{F4} simply does not work on my system, but the other way does work?
To be perfectly clear, my question is: Can anyone identify a problem with this script? Or does anyone have any ideas for things I can try to prevent the control key from being stuck after the script runs?
[code=auto:0]; Author: A.N.Other <[email protected]>
; ; Script Function: ; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder) ; #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. SetKeyDelay,10,30 pltMfd1PosX:=3 pltMfd1PosY:=123 pltMfd1Width:=634 pltMfd1Height:=479 pltMfd2PosX:=1380 pltMfd2PosY:=123 pltMfd2Width:=634 pltMfd2Height:=479 WinActivate,Orbiter Send {LCtrl down } ; Send {F4} ; Send {LCtrl up } ; WinWait, Custom Control, ChooseString, External Mfd, ListBox1, Custom ControlClick, Button1, Custom WinWait,MFD WinSetTitle,pltMfd1 WinMove,pltMfd1,,%pltMfd1PosX%,%pltMfd1PosY%,%pltMfd1Width%,%pltMfd1Height% WinGet,pltMfd1Handle,ID,pltMfd1 WinActivate,Orbiter Send {LCtrl down } ; Send {F4} ; Send {LCtrl up } ; WinWait, Custom Control, ChooseString, External Mfd, ListBox1, Custom ControlClick, Button1, Custom WinWait,MFD WinSetTitle,pltMfd2 WinMove,pltMfd2,,%pltMfd2PosX%,%pltMfd2PosY%,%pltMfd2Width%,%pltMfd2Height% WinGet,pltMfd2Handle,ID,pltMfd2 WinActivate,Orbiter return