我正在尝试在 Delphi 中获取笔记本电脑触摸板上的手指位置。不是光标在屏幕上的位置。所以我可以将它用于绘图目的。这可能吗?我怎样才能做到这一点?是否有任何 Windows API 或任何组件?
谢谢你的帮助。
更新
我找到了一款适用于联想触摸板的软件,可以做到这一点。它只显示手指在触摸板上的位置,PEiD 说它是用 Visual C++ 编写的。所以我想这是可能的,但正如大卫赫弗南所说,这取决于触摸板的制造商,它是特定于硬件的。
Coincidentally, I've just spent the last 30 minutes researching this very thing.
Windows supports this through the touch and gestures APIs. These were introduced in Windows 7 but touchpad drivers didn't tend to offer the necessary support until Windows 8 arrived and made it a logo requirement.
Synaptics and Alps seem to be the principal touchpad manufacturers and they have both released updated drivers for Windows 8 which also work on Windows 7. "Multitouch" is the keyword to search for. This is touchpad-model dependent though; I can't find an update for older Alps devices.
In short, this should work on a "Designed for Windows 8" laptop. It may work on Windows 7 and if it doesn't you may be able to get an updated driver.
简短的回答通常是否定的,这是不可能的。触摸板驱动程序呈现给操作系统,以便它们的外观和行为像鼠标一样。绝对坐标不可用。对于此应用程序,您需要合适的触摸屏设备或平板电脑,至少如果您正在寻找操作系统支持的通用解决方案。
当然,某些触摸板可能会通过特定于硬件的驱动程序提供此信息,但您需要支持(甚至可以选择)每个设备独立。例如,Synaptics提供了可以公开绝对坐标信息 的 SDK和驱动程序。
对于支持“笔和触摸”输入的平板电脑或其他全屏数字化仪,此信息通常通过WM_TOUCH
消息获得。一些高级触摸板可能支持这一点 - 您可以随时查询以发现支持的功能。对于那些,您必须注册应用程序的窗口才能接收触摸消息,如下所述:
收到WM_TOUCH
消息后,您可以通过立即将触摸句柄传递给 来获取详细信息GetTouchInputInfo
。它返回一个TOUCHINPUT
结构数组,每个结构都携带有关数字化仪表面上每个活动接触点的信息。