如何识别输入事件来自触摸板或鼠标? [英] How to identify an input event is from touchpad or mouse?

查看:235
本文介绍了如何识别输入事件来自触摸板或鼠标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Teams,



我正在尝试集成(精确)触控板支持。我想要的是身份输入事件来自触摸板或鼠标。我阅读了https://msdn.microsoft.com/en-us/library/windows/desktop/hh454916(v=vs.85).aspx和https://msdn.microsoft.com/en-us/library/windows /desktop/hh448801(v=vs.85).aspx
并尝试调用GetPointerType,GetPointerInfo和GetCurrentInputMessageSource,这些都不能告诉触摸板的输入来自触摸板。 



我试过Windows 10,vs2017在XPS和Surfacebook上试过。这是我的演示代码https://github.com/chaopeng/tons-of-issues/tree/master/windows-cannot-identify-input-from-touchpad。



是否有任何配置丢失或我应该打电话给其他api?

Hi Teams,

I'm trying to integrate (Precision) Touchpad support. What I want is identity a input event is from Touchpad or mouse. I read https://msdn.microsoft.com/en-us/library/windows/desktop/hh454916(v=vs.85).aspx and https://msdn.microsoft.com/en-us/library/windows/desktop/hh448801(v=vs.85).aspx and tried call GetPointerType, GetPointerInfo and GetCurrentInputMessageSource, none of these can tell the input from touchpad is from touchpad. 

I tried on Windows 10, vs2017 on XPS and Surfacebook. Here is my demo code https://github.com/chaopeng/tons-of-issues/tree/master/windows-cannot-identify-input-from-touchpad.

Is there any configuration missing or I should call other api?

谢谢。

Chao

推荐答案

我认为(未经测试)INPUT_MESSAGE_DEVICE_TYPE枚举

对此任务有帮助:



INPUT_MESSAGE_DEVICE_TYPE枚举

https://msdn.microsoft.com/en-us/library/windows/desktop/hh448795(v = vs.85).aspx



INPUT_MESSAGE_SOURCE结构

https://msdn.microsoft.com/en-us/library/windows/desktop/hh448799(v = vs.85)的.aspx



- Wayne



PS - 我不确定这是解决这个问题的最佳论坛。也许:



一般Windows桌面开发问题

https://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/threads



Windows桌面的用户界面开发

https://social.msdn.microsoft.com/Forums/en-US/windowsuidevelopment/threads



开发通用Windows应用程序

https:// social。 msdn.microsoft.com/Forums/en-US/wpdevelop/threads

I would think (untested) that the INPUT_MESSAGE_DEVICE_TYPE enumeration
would be helpful for this task:

INPUT_MESSAGE_DEVICE_TYPE enumeration
https://msdn.microsoft.com/en-us/library/windows/desktop/hh448795(v=vs.85).aspx

INPUT_MESSAGE_SOURCE structure
https://msdn.microsoft.com/en-us/library/windows/desktop/hh448799(v=vs.85).aspx

- Wayne

P.S. - I'm not sure this is the best forum for this issue. Perhaps:

General Windows Desktop Development Issues
https://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/threads

User Interface development for Windows Desktop
https://social.msdn.microsoft.com/Forums/en-US/windowsuidevelopment/threads

Developing Universal Windows apps
https://social.msdn.microsoft.com/Forums/en-US/wpdevelop/threads


这篇关于如何识别输入事件来自触摸板或鼠标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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