设备被误认为串行鼠标 [英] Device misdetected as serial mouse

查看:268
本文介绍了设备被误认为串行鼠标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过(虚拟)串行端口与PC进行通信。问题是我们偶尔发送的数据被Windows作为总线鼠标错误地标识,之后加载了Microsoft Serial Ballpoint驱动程序,鼠标指针开始在屏幕上跳动并随机点击事物。



一些Google搜索引擎显示,这是串行设备的一个老旧且众所周知的问题,通常的解决方法是一些注册表黑客来禁用违规驱动程序。然而,我们的用户要求很多,我宁可不用将用户的注册表搞乱。特别是当修复程序取决于Windows版本,用户可能会使用总线鼠标。



相反,我想通过更改协议来避免此问题不发送可能会误认为鼠标的任何数据。唯一的问题是我不太清楚要避免的模式。
显然,Microsoft的鼠标协议包含四个字节的数据包,其中第一个的MSB被设置,最后三个的MSB是清除的。



只发送7位ASCII是否足够?有没有其他设备需要担心被检测到?

解决方案

我刚刚在 Windows 7 Professional x64 ,为我工作的解决方案是进入注册表并编辑以下值:



位置: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\sermouse

密钥:开始

值:3



更改 4 ,这是已禁用,它会停止这个问题发生。



reg编辑命令如下:

  REG ADDHKLM\SYSTEM\CurrentControlSet\Services\sermouse/ V开始/ T REG_DWORD / F / D 4 

然后您需要重新启动计算机,现在应该正确启动,而不是尝试发现串行鼠标。



祝你好运。 p>

I'm working on a device which communicates with a PC through a (virtual) serial port. The problem is that the data we are sending occasionally gets incorrectly identified by Windows as a bus mouse, after which the "Microsoft Serial Ballpoint" driver is loaded and the mouse pointer starts jumping around on the screen and randomly clicking on things.

A bit of Googling reveals that is an old and well-known problem with serial devices where the usual work-around is a bit of registry hacking to disable the offending driver. That it is a lot to demand from our users however and I'd rather not have our application messing around with the user's registry. Especially not when the fix is dependent on the Windows version and the user may well be using a bus mouse.

Instead I'd like to avoid the problem by changing our protocol to not send any data which may get us misidentified as a mouse. The only problem is that I'm not quite certain what patterns to avoid. Apparently Microsoft's Mouse protocol consists of packets of four bytes where the MSB of the first is set and that of the last three is clear.

Would sending only 7-bit ASCII suffice? Are there any other devices I need to worry about being detected as?

解决方案

I just encountered this problem myself on Windows 7 Professional x64, and a solution that worked for me was to go into the registry and edit the following value:

Location: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\sermouse
Key: Start
Value: 3

Change Value to 4, which is Disabled and it will stop this problem occurring.

A reg edit command would be as follows:

REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\sermouse" /V Start /T REG_DWORD /F /D 4

You then need to restart the computer, which should now start correctly and not attempt to discover a serial mouse.

good luck.

这篇关于设备被误认为串行鼠标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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