123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|685|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Off Topic -> Creepy Mouse Tracking

Thu, 01 Nov 2018, 10:31
spinal
Can anyone recommend a free language that you allow me to code a windowless image that follows the mouse pointer?

-=-=-
Check out my excellent homepage!
Thu, 01 Nov 2018, 10:31
Jayenkai
In what way "follows"? As in the window sits in the corner tracking the mouse, or the window literally moves to follow the mouse?

-=-=-
''Load, Next List!''
Thu, 01 Nov 2018, 10:46
Dan
Something like this ?

(the characters are actually in a transparent borderless window (big as their size) and could be drag'n'dropped)


View on YouTube

It's done with autoIt 3

You can find a download of my modification of the screenmate here: Emu.Zone or from the original author (link is in the description on y-tube)

(the download contains sourcecode which works with a previous version of autoit, but only small modifications are needed to make it work with the newest one)

ill upload the working one if it is what you thought of.
Thu, 01 Nov 2018, 11:31
spinal
I have a specific task in mind, but it sounds right.
I want to
a. Know where the mouse pointer is globally.
b. be able to plonk an image/animation near it at a given circumstance.

-=-=-
Check out my excellent homepage!
Thu, 01 Nov 2018, 11:37
Jayenkai
Maybe time to look at C/++?
Fri, 02 Nov 2018, 04:56
Dan
Here is an autoit example of "global" mouse tracking:



What it does is: whenever you (left mb)click somewhere on the screen, it drops an tooltip with coordinates near the mouse.

Autoit is very similar to basic, but it has no Goto/Gosubs now (they removed it ...)
The good thing is, you need not to worry about variable type's, as they all start with $

The bad thing is, some antivirus progs recognize the compiled executable as threat.

here is the link to the above's compiled code scan on virus total


Iv uploaded the (updated) universal screenmate sourcecode and the binaries on the Emu.Zone

p.s.Autoit forums have other examples of displaying pictures without visible window.
Fri, 02 Nov 2018, 08:11
spinal
I really need to find some time for this, thanks Dan, autoit looks like it will work perfectly 😁

-=-=-
Check out my excellent homepage!
Sun, 04 Nov 2018, 03:01
spinal
Ummmm that false positive virus reading is an issue. My computer won't let me compile my script 😯 apparently using an earlier version might get around it, I'll give that a try.

-=-=-
Check out my excellent homepage!
Sun, 04 Nov 2018, 03:08
Dan
Try to uncheck "Use upx" first. Or changing "Fileinstal Compression" to lowest
Sun, 04 Nov 2018, 12:30
spinal
I didn't know there were options.... Where might those be?

-=-=-
Check out my excellent homepage!
Mon, 05 Nov 2018, 10:42
Dan
Here i'm using the Scite 4 autoit to compile autoit scripts.

When the Scite is open, and an au3 file is loaded, then i can use Tools/compile menu to open a compiling window called "AutoIt3Wrapper gui to compile AutoIt3 scripts"
There you should be able to set the options.

Or, open the AutoIt3 installation folder, there is an Aut2exe folder. Both Aut2exe.exe and Aut2exe_x64.exe in there have options to disable UPX and to set compression level.

Optionally, at the top of your script, you can disable the compilation of the script by setting a compiler directive:



So this script would not use UPX at all.

I hope this can help.
Tue, 06 Nov 2018, 00:17
spinal
The script did the trick. I don't know if our versions are different, but the tool/compile menu item doesn't give my any options.

Just one last thing to add to the script, then I will release if for the world!

-=-=-
Check out my excellent homepage!
Tue, 06 Nov 2018, 01:59
spinal
Done!....

http://spinalcode.co.uk/2018/11/06/windows-shake-to-find-cursor/



Shake to find the cursor in windows! Also, check how many miles your mouse has moved!

-=-=-
Check out my excellent homepage!
Tue, 06 Nov 2018, 08:02
Dan
Great !
Tue, 06 Nov 2018, 08:27
Jayenkai
You crazy coder!!!
Sat, 20 Jul 2019, 04:41
spinal
hmmm, can anyone think of an easy way to detect multiple direction changes in mouse movement? I'm too tired right now to even try detecting the rough direction. should be trivial though right?

-=-=-
Check out my excellent homepage!
Sat, 20 Jul 2019, 04:59
Jayenkai
In main loop



That's "the last frame" only, though, and the direction might be a bit twitchy that soon. (oh, and I can never be sure which way ATan2 goes, so you might need to swap the mw's and the m's)
You'll probably want to store the last 3 or 4 frames, and judge the angle out based on the first and last, so you get a smoother direction.

-=-=-
''Load, Next List!''
Sat, 20 Jul 2019, 08:04
spinal
Doesn't really need to be smooth, just need to track multiple successive direction changes

-=-=-
Check out my excellent homepage!
Sat, 20 Jul 2019, 09:07
Jayenkai
You'll need to smooth it so that it won't, for example, recognise when your finger/stylus wiggles a bit!
Track the movement over 3 or 4 frames, ensure the distance between "now" and "then" is more than a few pixels, then count that as movement.

-=-=-
''Load, Next List!''
Sat, 20 Jul 2019, 09:42
spinal
Cheated...

Rather than checking actual direction over distance, just checked if x/y was different and not 0. seems a little better than my older 'is it fast' method.



Although the code could possibly be tidier.

-=-=-
Check out my excellent homepage!