tried V2 and I use this simulation software that has 3d visualization that uses mouse in his own way. I had all working fine in V1 but now with V2 the WinActive makes it run either the window is active or not... which messes up scrolling in a portion of the screen. I tried WinWaitActive, but it does the same thing... might have something wrong in the script, thus I'm placing it below.
Thanks,
Ric
Code: Select all
;#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#InstallKeybdHook
#InstallMouseHook
#Warn ; Enable warnings to assist with detecting common errors.
SendMode "Input" ; Recommended for new scripts due to its superior speed and reliability.
;SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode "Mouse", "Screen"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMSOL
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;if WinActive("ahk_exe comsol.exe")
if WinWaitActive("ahk_exe comsol.exe")
{
` & F2::
{
MouseClick "left", 679, 64
Sleep 223
MouseClick "left", 2380, 141
Sleep 334
Send "{Enter}"
Sleep 345
MouseClick "left", 767, 62
Sleep 334
MouseClick "left", 1654, 132
Sleep 345
Send "{Enter}"
Sleep 2111
MouseClick "left", 55, 59
Sleep 345
MouseClick "left", 55, 345
Sleep 345
}
RButton::
{
MouseGetPos xpos, ypos, id, control
if xpos > 984 ;1500
{
Send "{Click, WheelUp}"
}
if xpos <= 984 ;1500
{
Send "{Click, right}"
}
}
+RButton::Send "{Click, WheelDown}"
^MButton::Send "{Click, down, right}"
;+MButton::MButton
MButton::LButton
WheelDown::
{
MouseGetPos xpos, ypos, id, control
if (xpos > 984 and ypos < 863)
{
; DetectHiddenWindows True ;Send a Pause command to another script.
; WM_COMMAND := 0x111
; ID_FILE_PAUSE := 65403
; PostMessage WM_COMMAND, ID_FILE_PAUSE,,, "C:\Users\balistreriric\$Apps\pushmouse.ahk ahk_class" AutoHotkey
Send "{Click, down, middle}"
shifto := ypos - 40
MouseMove xpos, shifto, 100
Send "{Click, up, middle}"
MouseMove xpos, ypos, 100
}
else
{
Send "{Click, WheelDown}"
}
}
WheelUp::
{
MouseGetPos xpos, ypos, id, control
if (xpos > 984 and ypos < 863)
{
MouseGetPos xpos, ypos, id, control
Send "{Click, down, middle}"
shifto := ypos + 40
MouseMove xpos, shifto, 100
Send "{Click, up, middle}"
MouseMove xpos, ypos, 100
}
else
{
Send "{Click, WheelUp}"
}
}
Return
}
Else
{
Return
}