Python Wacom Interface

戏子无情 提交于 2019-12-08 03:05:54

问题


I am trying to write a python script on Windows 7 to interact with my Wacom Bamboo Pen tablet. Wacom recommends using the WinTab API, and it works fine, but not for my application. I don't want the Wacom tablet to act as a pointing device (as in, it should not move the cursor). All I want is raw x, y data from the device.

What is the best way to implement this? Do I have to write a different driver for the tablet to allow this? Or can I modify the existing Wacom driver to not affect the system cursor.


回答1:


I think, in wintab you can get the raw coordinates. At least in Python wrapper for wintab you can access them:

cgkit.wintab.Packet.x

In absolute mode, contains the scaled cursor location along the x axis. In relative mode, contains the scaled change in cursor position.

cgkit.wintab.Packet.y

In absolute mode, contains the scaled cursor location along the y axis. In relative mode, contains the scaled change in cursor position.

I'm investigating for myself if there is an cross-platform api for tablets, but if you need windows-only solution that should work.



来源:https://stackoverflow.com/questions/4848694/python-wacom-interface

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!