Page 1 of 1
ControlClick
Posted: Wed Oct 08, 2008 9:58 am
by 3cmSailorfuku
http://www.autoitscript.com/autoit3/doc ... lClick.htm
It sends a mouseclick to a window without having the focus, I wonder if its possible to add it in micromacro hmm.
Re: ControlClick
Posted: Wed Oct 08, 2008 4:37 pm
by Administrator
Thanks for the info. I was actually thinking about this the other day and got sidetracked so I forgot about it. I'll have to look into how I can possibly get this to work with attach().
Re: ControlClick
Posted: Fri Oct 17, 2008 2:14 am
by Administrator
I have just recently added this, but it needs some testing. In my tests, it was able to send mouse input to Metin 2 without stealing focus. Should work, but it's best to make sure.
It will not try to use SendInput when the application has focus, so make sure the program will allow for attached input first. The same will be going for keyboard input in the future (but if you ever need to use both methods, it is really easy to do this, too).
If you (or others) could please test mouse input in an application or two (which allows attached input [use attached keyboard messages to check]) and report back, that would help.
Experimental micromacro.exe attached.
Re: ControlClick
Posted: Fri Oct 17, 2008 3:38 pm
by 3cmSailorfuku
elverion wrote:I have just recently added this, but it needs some testing. In my tests, it was able to send mouse input to Metin 2 without stealing focus. Should work, but it's best to make sure.
It will not try to use SendInput when the application has focus, so make sure the program will allow for attached input first. The same will be going for keyboard input in the future (but if you ever need to use both methods, it is really easy to do this, too).
If you (or others) could please test mouse input in an application or two (which allows attached input [use attached keyboard messages to check]) and report back, that would help.
Experimental micromacro.exe attached.
Can you post the function name with its arguments? Or is it equal to the one from autoit?
Re: ControlClick
Posted: Fri Oct 17, 2008 5:27 pm
by Administrator
Same mouse functions as before. The only difference is that attach() now attaches mouse input, as well.
Code: Select all
win = findWindow("Example");
attach(win);
local x, y;
while(true) do
x,y = mouseGetPos();
mouseSet(x, y);
mouseLClick();
yrest(100);
end
One thing that people might think is strange is the mouse movement. If you use mouseSet(32,64), then move your physical mouse pointer to somewhere else, and then use mouseLClick(), the click will take place at (32,64), not where the physical mouse pointer is. This is just something to keep in mind. If you want to generate mouse clicks (in attached mode) where the physical pointer is, just use mouseGetPos() to get the current physical pointer position, then mouseSet() to reposition the virtual mouse pointer.
Re: ControlClick
Posted: Sun Oct 26, 2008 3:15 pm
by 3cmSailorfuku
I just had time to test this completly, it works but I don't get the problem you encountered, metin2 might be the cause of the problem.
Though it greatly depends on how the Game is programmed. I noticed a few difficulties like the mouseclick goes through monsters,
but It's enough for my needs thank you.
Re: ControlClick
Posted: Sun Oct 26, 2008 6:30 pm
by Administrator
It should not be game dependent. When attached, the mouse will click at the location it was last positioned. So if you use setMouse(32, 32), then actually move your mouse to some other location, it will still click at (32,32). I think I just wasn't clear on this before.
I'm not sure about the clicks "going through" monsters. There's a ton of reasons it could be doing that. I guess the important thing is that it worked. Thanks for the testing.
Re: ControlClick
Posted: Mon Oct 27, 2008 1:32 pm
by 3cmSailorfuku
elverion wrote:It should not be game dependent. When attached, the mouse will click at the location it was last positioned. So if you use setMouse(32, 32), then actually move your mouse to some other location, it will still click at (32,32). I think I just wasn't clear on this before.
How's that strange then, it's a good thing.

Re: ControlClick
Posted: Mon Oct 27, 2008 2:38 pm
by Administrator
Indeed. It is an intended behavior, but I'm sure some people might not quite realize right away why it is not clicking where the user has their mouse.
Re: ControlClick
Posted: Tue Oct 28, 2008 11:36 am
by 3cmSailorfuku
elverion wrote:Indeed. It is an intended behavior, but I'm sure some people might not quite realize right away why it is not clicking where the user has their mouse.
Also, can you include a function to rename captions of windows?
Re: ControlClick
Posted: Tue Oct 28, 2008 12:59 pm
by Administrator
There's already a
setWindowName() function.