在Javascript中检测触摸板与鼠标 [英] Detect touchpad vs mouse in Javascript

查看:102
本文介绍了在Javascript中检测触摸板与鼠标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法检测客户端是否使用触摸板而不是使用Javascript的鼠标?

Is there any way to detect if the client is using a touchpad vs. a mouse with Javascript?

或者至少可以获得一些合理的估计数量使用触摸板而不是鼠标的用户?

Or at least to get some reasonable estimate of the number of users that use touchpads as opposed to mice?

推荐答案

在一般情况下,没有办法做你想做的事。 ActiveX 可能允许您查看和检查USB设备,但在最好的情况下,即使这在某种程度上可能,也会限制您使用IE用户。除此之外,没有办法知道。

In the general case, there is no way to do what you want. ActiveX might allow you to see and examine USB devices, but in the best case, even if that is somehow possible, that limits you to IE users. Beyond that, there is no way to know.

您可能能够辨别触摸板用户移动光标的方式(或频率)与鼠标用户移动光标的方式。以这种方式区分物理输入设备是一个非常困难的前景,并且可能完全不可能,所以我在此仅包括完整性。

You might be able to discern patterns in how (or how often) a touchpad user moves the cursor versus how a mouse user might move the cursor. Differentiating between physical input devices in this way is an absurdly difficult prospect, and may be wholly impossible, so I include here it for completeness only.

这篇关于在Javascript中检测触摸板与鼠标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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