Mouse sample

I am looking to create an application that will force the mouse to follow a specific pattern. One idea is to upload a bitmap like

enter image description here

for example, then make a mouse following this line.

Can someone point me in the right direction? I am currently playing with

[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
    public static extern void mouse_event(uint dwFlags, int dx, int dy, int dwData, int dwExtraInfo);

Usage example for moving the mouse 5px down

mouse_event(MOUSEEVENTF_MOVE, 0, 5, 0, 0);

Which will work well for my purpose, but I would really like for him to follow the pattern.

If anyone has any ideas that can help / improve what I'm looking for, I will be so grateful!

Thanks in advance

+4
source share
1 answer

There are several commonly used path search algorithms:

Dijkstra's algorithm and A * are very popular.

, . ( .)

- , : http://en.wikipedia.org/wiki/Pathfinding#Sample_algorithm

0

Source: https://habr.com/ru/post/1543238/


All Articles