如何检测鼠标点击是否合法或自动? [英] How to detect if mouse click is legit or automated?

查看:534
本文介绍了如何检测鼠标点击是否合法或自动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何知道是否模拟鼠标点击?当程序或真正的鼠标设备鼠标点击发送

How to know if a mouse click is simulated or not? When mouse click send by a program or real mouse device

...我编程的游戏系统检测,以避免机器人,高压锅等,只接受合法鼠标点击

... I'm programming a system detection for a game to avoid bots, autoclicks,etc that only accept legit mouse clicks

推荐答案

这取决于你正在写的应用程序的种类,但如果可以,运动,而不是点击。
人类鼠标移动的速度不一,反应时间,不精确(点击不同的按钮坐标等)。

This depends a bit on the kind of application you are writing, but if you can, I would watch the cursor movement, not the clicks. Human mouse movement has non-uniform speeds, reaction times, imprecisions (clicks on different coordinates of your buttons, etc...).

可以通过随机要求难以编写脚本的交互来防御机器人。例如:如果脚本依赖于按钮总是在相同的位置,我会确保,尽管保持直观,对话框应该每次都会弹出在稍微不同的位置。

Also, you can defend a gui against bots by randomly requiring an interaction that is hard to script. For example: If scripts depend upon buttons being always in the same position, I would make sure that, while trying to remain intuitive, the dialog should pop up in slightly different positions every time.

否则:没有办法检测鼠标是真实的还是真正很好的模拟。 Windows HID / MacOS / Linux驱动程序层提取了小鼠,TrackPens,TrackBalls,绘图板,触摸屏...之间的区别...当然是脚本鼠标...

Otherwise: There is no way to detect if the mouse is a real one or a really well simulated one. The Windows HID/MacOS/Linux driver layer abstracts away the distinction between Mice, TrackPens, TrackBalls, draw-pads, touch screens... and of course script-mice...

这篇关于如何检测鼠标点击是否合法或自动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆