我需要通过Python访问windows平板电脑笔数据(比如表面)。我主要需要位置,压力和倾斜值。在
我知道如何访问Wacom笔数据,但windows笔不同。在
有一个名为Kivy的Python库可以处理多点触控,但它将我的笔识别为手指(WM_touch)而不是笔(WM_pen)。在
这是我的Kivy代码(不报告压力和倾斜):
from kivy.app import App
from kivy.uix.widget import Widget
class TouchInput(Widget):
def on_touch_down(self, touch):
print(touch)
def on_touch_move(self, touch):
print(touch)
def on_touch_up(self, touch):
print("RELEASED!",touch)
class SimpleKivy4(App):
def build(self):
return TouchInput()
有一个很棒的processing库,名为Tablet,它只适用于具有简单API的Wacom平板电脑(例如tablet.getPressure()
)
我需要这样的东西。在
这个解决方案适用于我,它适用于here中的Python3。在
工作原理:笔,橡皮擦,笔按钮,两个压力传感器。在
首先安装pyglet库:
pip install pyglet
。然后使用代码:相关问题 更多 >
编程相关推荐