is there an API for python to work with pressure-sensitive pen-tablets? (Mac OS, Linux)

浪尽此生 提交于 2020-01-03 05:14:12

问题


I want to write a cross-platform wxPython app, and I'm wondering if there a single API to work with pen-tablets on different platforms? I'm only interested to get pressure value and ereaser flag - but I couldn't fined anything cross-platform for python.

UPD. so far, I found only windows-specific solution, what are the options for Mac OS and Linux?


回答1:


https://bitbucket.org/AnomalousUnderdog/pythonmactabletlib

A small Python library to allow Python scripts to access pen tablet input data in Mac OS X.

The library exists as plain C code compiled as a dynamic library/shared object. It interfaces with the Mac OS X's API to get data on pen tablet input.

Then, Python scripts can use ctypes to get the data.

Send me a message if you have any problems with it.




回答2:


If your target tablets are HIDs, which they probably are, you can use python-hid.



来源:https://stackoverflow.com/questions/4978835/is-there-an-api-for-python-to-work-with-pressure-sensitive-pen-tablets-mac-os

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