Performing action on mouse stop - Page 2 - Forum

Forum Navigation
You need to log in to create posts and topics.

Performing action on mouse stop

PreviousPage 2 of 2

I did a quick search through my applications where I have used the commands to detect the mouse position and I found these three examples:

  • The command "dec_MouseInformation" of the old plugin dec_Sys v1.3 of our friend David Esperalta shows us among other mouse data the X and Y coordinates in the variables [dec_CursorPosX] and [dec_CursorPosY].
  • From David Esperalta also, the npGetMousePos command of the npUtil plugin (https://www.decsoftutils.com/neoplugins). This is the one I normally use since a long time.
  • The commands hpwAutoItMouseGetPosX and hpwAutoItMouseGetPosY of the hpwAutoIt plugin of another great friend of the community Hans-Peter Wickern (https://visualneo.com/shop/hpws-freeware)

I hope this helps @talker

Vadim has reacted to this post.
Vadim

@vadim

Yes, the context menu appears and the asNeoPopupMenu plug-in claims to work......
it's not a AV issue either. Indeed I think it solely has to do with Windows 10, ask CN_Iceman mentioned as well.

I am actually curious if the compiled executable, will work on my system. Can you upload that?
If that works then I will install NEO on my Windows 7 laptop or do a virtualized installation with VirtualBox on my Windows 10 machine.

CN_Iceman

Thanks for your help. However, I don't see npGetMousePos in decsoft utilities. I do see npGest, which I tested, but does not appear to work on my system...
About hpwAutoIt. Does this using source code from AutoIt? I'm trying to stay away from programs that have GPL/GNU license (AutoIt and AHK).

@talker

Here are the compiled versions of the demo projects.

StartStopMotionMouse_asNeoPopupMenu.exe
https://yadi.sk/d/RdAagCupW8WjDQ

StartStopMotionMouse_zmFunctions.exe
https://yadi.sk/d/bMgzsl5toVAMpQ

Sadly the same result as with the script :-(

This example script from neobookeros.com.ar seems to work on my system. In the sense that pointer one responds to pointer two (so it's grabbing the mouse coordinates and performing an action).
Can parts of this perhaps be used to get the results we are aiming at?

http://www.neobookeros.com.ar/2010/08/14/ejemplo-2-mouses/

You can do everything without plugins.

The [MouseStop] variable will contain true or false depending on whether the mouse is moving or stopped.

 

The global monitor in the Zmfunctions plugin on Windows 10 does not work

Uploaded files:
  • You need to login to have access to uploads.
Vadim has reacted to this post.
Vadim

@talker

You can try the mishem approach or here's another one from BuNKeR (on your website):

Thanks Mishem and Vadim,

I'm now trying with a simple If Else statement (assuming that when the mouse position has changed in any way it will be considered "Else":

 

GetMousePos "[x]" "[y]"
SetVar "[x1]" "[x]"
SetVar "[y1]" "[y]"

If "[x1] = [x] AND [y1] = [y]"
Return

Else
TimerStop "Timer1"
AlertBox "" "The mouse has moved."
TimerStart "Timer1" "1000"
EndIF

 

However, I'm getting: "This action requires three parameters". Am I comparing the wrong things?

I also noticed in Mishem's script that the value of both x1 and x is the same (and the same goes for y1 and y). Shouldn't this be different?

 

Hello,

https://winhelp.visualneo.com/Control.html#IFEX

Regards

luishp has reacted to this post.
luishp
Quote from Talker on October 4, 2021, 9:12 pm

I don't see npGetMousePos in decsoft utilities.

The "npGetMousePos" command is on npUtil plugin.

@talker

1) In the mishem project, look at the code on the "Idle Event" tab in the project properties. There variables [x1] and [x] are updated.

2) During testing in the debugger, look at the value True or False in the [MouseStop] variable (depending on whether the mouse is standing or moving - it is updated after 1 second).

3) The IF command has three parameters, i.e. three pairs of quotes (what, how, and to what is compared). The IFEx command has one parameter. Your entry corresponds to the IFEx command, which Hans-Peter (hpw) gave you a link to above.

@talker

I also noticed in Mishem's script that the value of both x1 and x is the same (and the same goes for y1 and y). Shouldn't this be different?

When the mouse is in the application window, the variables x, x1, y, y1 remain unchanged until the mouse stops. Since while the mouse is moving, the code does not work. Outside the window, these variables change, since the application believes that it has stopped with it and the code begins to work.

You can change the waiting time on the "Idle Event" tab. I installed 1 second. You can ask your right time, and not use the timer.

Thanks all!

I've now got it to work with a timer. Not On Mouse Stop but On Mouse Move.  I attached it.

So now it will respond whenever you Move the mouse instead of whenever you Stop Moving the mouse. I would have preferred the latter but that would repeat the action (in this case: showing the balloon) endlessly. If there's a way around that (keeping this script going, without a timer) I would like to know!

All in all, I'm really happy to at least get the On Mouse Move working :-)

BTW, it appears that for showing the balloon the app needs to have the focus. With other actions, clicking the mouse or  running an application, that appears to not be necessary.

Uploaded files:
  • You need to login to have access to uploads.
luishp and Vadim have reacted to this post.
luishpVadim

@talker

Try.

 

Uploaded files:
  • You need to login to have access to uploads.
luishp and Vadim have reacted to this post.
luishpVadim

Thank you very much Mishem :-). This works very well!

PreviousPage 2 of 2