B
B
BobKelsa2021-05-14 23:14:44
Automation
BobKelsa, 2021-05-14 23:14:44

How to close the program if there is a mouse movement?

There is a certain program which needs to be closed instantly if there is a movement of a mouse. How to do it ? Maybe in the Windows task scheduler there is something some kind of trigger for moving the mouse to launch the batch file to close the program, or there are some ready-made solutions.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Ananiev, 2021-05-15
@SaNNy32

You can try running the program as a screen saver. https://superuser.com/questions/426870/run-an-appl...

W
wisgest, 2021-05-15
@wisgest

On AutoHotkey, you can periodically check the position of the pointer (see MouseGetPos ; Russian translation )

MouseGetPos x0, y0
Loop {
  Sleep 1
  MouseGetPos x1, y1
} Until x0 "," y0 != x1 "," y1

then call one of the Process Close , WinClose or WinKill commands ...
Apparently, AutoIt ( en | ru ) will also do.
There is also (not tested) an example of working with a mouse in VBScript (Excel automation object and VBA are used).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question