在Python中实现了WindMouse算法。

2作者: AsfhtgkDavid大约 12 小时前原帖
嗨,HN, WindMouse 是一个相对较老且广为人知的算法,用于生成类人鼠标移动(曲线路径、可变速度、自然减速)。它在自动化讨论中经常被提及,但令人惊讶的是,我找不到一个干净、经过良好测试且可重用的 Python 库实现。 因此,我决定自己来实现它。 这个项目现在以 *WindMouse* 的名称发布: * 强类型(坐标使用 *NewType*,兼容 mypy) * 两个后端: ``` * PyAutoGUI(跨平台) * AutoHotkey(Windows) ``` 算法本身并不新颖——新颖的是它的实现。我的目标是创建一个可以下载并立即在项目中使用的工具。 我希望能得到以下方面的帮助: * 在不同操作系统环境下的 *测试*(特别是 macOS 的边缘案例) * *新后端*(例如本地 macOS、Wayland、低级 Windows API、游戏引擎、远程桌面) * 对 API 设计和参数默认值的反馈 欢迎提出关于算法、设计决策或权衡的任何问题。
查看原文
Hi HN,<p>WindMouse is a fairly old and well-known algorithm for generating human-like mouse movements (curved paths, variable speed, natural deceleration). It’s often referenced in automation discussions, but surprisingly I couldn’t find a clean, well-tested, reusable implementation as a Python library.<p>So I decided to implement it myself.<p>The project is now released as <i>WindMouse</i>:<p>* Strong typing (<i>NewType</i> for coordinates, mypy-friendly)<p>* Two backends:<p><pre><code> * PyAutoGUI (cross-platform) * AutoHotkey (Windows) </code></pre> The algorithm itself is not new - the implementation is. My goal was to create something that could be downloaded and immediately used in projects.<p>I’m looking for help with:<p>* <i>Testing on different OS setups</i> (especially macOS edge cases) * <i>New backends</i> (e.g. native macOS, Wayland, low-level Windows APIs, game engines, remote desktops) * Feedback on API design and parameter defaults<p>Happy to answer questions about the algorithm, design decisions, or tradeoffs.