Python Wacom界面 [英] Python Wacom Interface

查看:206
本文介绍了Python Wacom界面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Windows 7上编写python脚本以与Wacom Bamboo Pen平板电脑交互. Wacom建议使用WinTab API,它可以正常工作,但不适用于我的应用程序.我不希望Wacom数位板充当定点设备(例如,它不应移动光标).我想要的只是来自设备的原始x,y数据.

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.

实现此目标的最佳方法是什么?我是否需要为平板电脑编写其他驱动程序才能允许这样做?还是可以修改现有的Wacom驱动程序以不影响系统光标.

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.

推荐答案

我认为,在wintab中,您可以获得原始坐标.至少在 wintab的Python包装器中,您可以访问它们:

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

在绝对模式下,包含已缩放的 沿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

在绝对模式下,包含已缩放的 沿y轴的光标位置.在 相对模式,包含缩放比例 更改光标位置.

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

我是 为自己调查是否有适用于平板电脑的跨平台api,但是如果您需要仅适用于Windows的解决方案.

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

这篇关于Python Wacom界面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆