在绘图项目中使用平板电脑
如何向我的项目添加对平板电脑绘图的支持?我的意思是,大多数数位板在定期握持时都具有充当“普通”指点设备的功能,但是当翻转笔时,它会充当橡皮擦(例如,OneNote 就是这样工作的)。
如何检测正在使用笔的哪一侧?
How can I add support for tablet drawing to my projects? What I mean is that most pen tablets have the functionality of acting as "normal" pointing devices when held regularly, but when the pen is flipped, it acts as an eraser (OneNote works this way, for example).
How can I detect which side of the pen is being used?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会遵循您平板电脑的本机 API。您的平板电脑供应商对 SDK 进行了非常详细的描述,其中包括多个
示例
(在 Visual C++ 中)。您具体寻找的是
橡皮擦检测
I would follow the native API of your tablet. Your tablet's vendor has very well described SDK including several
examples
(in Visual C++).What you are specifically looking for is
the eraser detection
如果您只想检测设备类型,那么处理 WinTab 就很容易了。然而,如果您想处理绝对位置、笔方向和压力,可能会变得更加混乱。有一个很好的 C++ 库可以处理这个问题:
http://www.billbaxter.com/projects /bbtablet/index.html
即使您不想通过包装来直接使用它,如果遇到困难,您也可以从源代码中学习。
Dealing with WinTab is easy enough if all you want is to detect device type. However it can get a lot more confusing if you want to process absolute positions, pen orientation and pressure. There's a good C++ lib for dealing with this:
http://www.billbaxter.com/projects/bbtablet/index.html
Even if you don't want to go through the effort of wrapping it to use it directly, you can learn from the source if you get stuck.