Using a Wacom Tablet as an input device

Hello!

I have been trying to use a Wacom Tablet as an input device in my Panda3D project. It is being recognized as a mouse, so I can get the ‘clicks’, but I also need the pen pressure and the pen tilt for my application.
I looked into the InputDevice.DeviceClass but I couldn’t find something relevant. Is there any way to get this input in Panda3D, or maybe are you aware of some external library that could be of use?

Thanks a lot!
Ioanna

Hmm… Have you tried the gamepad “Device Tester” sample program? That might show what inputs–if any–Panda recognises for the device.

That said… playing around with my Bamboo tablet in the sample programs (and based on prior experience to some degree), it doesn’t look like that device, at least, is well-supported. :/

Thanks for the suggestion. I run the example with my Wacom tablet connected, but I didn’t get any output.
When I print the InputDeviceManager.get_global_ptr().get_devices() it gives 0 input devices.

So I suppose it is indeed not supported. In that case I wonder what alternatives I have. Could I use some compatible external library? Do you know of any relevant example?

Thanks a lot!

I’m afraid that I don’t know of another library offhand, no–it’s not something that I’ve looked for, I’ll confess. Perhaps someone else will know of one!

When I print out my tablet InputDevice I get:
____HID_WACOMVIRTUALROUTER_Col01.1_2d595ca7_0_0000 (connected), virtual_device, pointer

And the device.type is PointerType.unknown

In the InputDevice class I found that in theory I should have access to PointerData and TrackerData where I should be able to get the values I am looking for. However when I create a task that prints out the pressure and orient of my device:

def track_device(self, task, device):
    print(device._pointer_data.pressure)
    print(device.tracker.orient)
    return task.cont

I only get:

0.0
1 + 0i + 0j + 0k

So either I am not querying the device in the right way, or I am missing some other steps to get its output in Panda3D.

Any ideas or proposals are very welcome :slight_smile:

Is this on Windows, Linux or macOS?

This is on windows.
Thanks,
Ioanna

We don’t currently support digitizers via the InputDevice API, but I just added some rudimentary support that seems to work for my Wacom Intuos. Give it a try:

https://buildbot.panda3d.org/downloads/b67c7dd84f6174f439ccafc3339cd2e850e47930/

It adds the InputDevice.DeviceClass.digitizer class and the InputDevice.Axis.pressure axis. They should show up in device_tester.py.

Mine has only pressure, and not anything fancy like tilt or twist, so I did not add those as I couldn’t test them. They could be added fairly easily if I had some help figuring out the inputs, though.

2 Likes

Many thanks for the immediate reply!

I installed the new build and gave it a try, and it can indeed recognise my tablet as a digitizer. It give me input for the x,y,z positions and pressure. It also finds some other inputs, but these are marked as ‘unknown’ and don’t return any values. It also doesn’t detect the 4 buttons of the device, but that’s not a problem for me.

Device connected
  Name        : Wacom Tablet
  Type        : digitizer
  Manufacturer:
  ID          : 056a:1015
  Axes        : 13 (x, y, z, pressure, none, none, none, none, none, none, none, none, none)
  Buttons     : 0 ()

So I suppose the twist and tilt should be somewhere in there, but I am not sure how I can find what is what. How could I figure out those inputs?

Thanks!

The z position is inverted, at least in my experience; it’s generating a positive value when I move closer to the tablet, whereas I’m expecting it to get closer to 0. Is it showing the same problem on your end?

As for the twist and tilt, well, are any of the axes in device_tester.py responding when you twist or tilt your pen? Could you describe the way the respective axes behave in detail when you twist and tilt the pen?

Could you also give me the command-line output for your device when you add “notify-level-device debug” in Config.prc?

Hello! THe z axis is inverted for me as well.

When I connect my device with “notify-level-device debug” I get:

:device(debug): Started input device listener thread.
:device(debug): GIDC_ARRIVAL: \\?\HID#VID_056A&PID_0376&Col04#6&9b0b2fe&1&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
:device(debug): Successfully loaded hid.dll
:device(debug): Found digitizer device "Intuos BT S" with 19 data indices, 6 button caps, 13 value caps
:device(debug): Found button: DataIndex=0, ReportID=213, UsagePage=0xd, Usage=0x32
:device(debug): Found button: DataIndex=1, ReportID=213, UsagePage=0xd, Usage=0x5a
:device(debug): Found button: DataIndex=2, ReportID=213, UsagePage=0xd, Usage=0x45
:device(debug): Found button: DataIndex=3, ReportID=213, UsagePage=0xd, Usage=0x3c
:device(debug): Found button: DataIndex=4, ReportID=213, UsagePage=0xd, Usage=0x44
:device(debug): Found button: DataIndex=5, ReportID=213, UsagePage=0xd, Usage=0x42
:device(debug): Found value: DataIndex=6, ReportID=213, UsagePage=0x1, Usage=0x30, LogicalMin=0, LogicalMax=32767
:device(debug): Found value: DataIndex=7, ReportID=213, UsagePage=0x1, Usage=0x31, LogicalMin=0, LogicalMax=32767
:device(debug): Found value: DataIndex=8, ReportID=213, UsagePage=0x1, Usage=0x32, LogicalMin=0, LogicalMax=1024
:device(debug): Found value: DataIndex=9, ReportID=213, UsagePage=0xd, Usage=0x30, LogicalMin=0, LogicalMax=4095
:device(debug): Found value: DataIndex=10, ReportID=213, UsagePage=0xff00, Usage=0x5b, LogicalMin=0, LogicalMax=4095
:device(debug): Found value: DataIndex=11, ReportID=213, UsagePage=0xd, Usage=0x5b, LogicalMin=0, LogicalMax=4095
:device(debug): Found value: DataIndex=12, ReportID=213, UsagePage=0xff00, Usage=0x77, LogicalMin=0, LogicalMax=4095
:device(debug): Found value: DataIndex=13, ReportID=213, UsagePage=0xd, Usage=0x31, LogicalMin=0, LogicalMax=1024
:device(debug): Found value: DataIndex=14, ReportID=213, UsagePage=0xd, Usage=0x3d, LogicalMin=-9000, LogicalMax=9000
:device(debug): Found value: DataIndex=15, ReportID=213, UsagePage=0xd, Usage=0x3e, LogicalMin=-9000, LogicalMax=9000
:device(debug): Found value: DataIndex=16, ReportID=213, UsagePage=0xd, Usage=0x40, LogicalMin=-9000, LogicalMax=9000
:device(debug): Found value: DataIndex=17, ReportID=213, UsagePage=0xd, Usage=0x3f, LogicalMin=0, LogicalMax=36000
:device(debug): Found value: DataIndex=18, ReportID=213, UsagePage=0xd, Usage=0x41, LogicalMin=0, LogicalMax=36000
:device(debug): Discovered input device Intuos BT S (connected), digitizer, 13 axes
Device connected
  Name        : Intuos BT S
  Type        : digitizer
  Manufacturer:
  ID          : 056a:0376
  Axes        : 13 (x, y, z, pressure, none, none, none, none, none, none, none, none, none)
  Buttons     : 0 ()

Other than the x,y,z axis, for all the other inputs called ‘none’ there’s no response when I use the tablet.The value that they return doesnt change at all. When I print out the values I get this:

x 0.4935148167363506
y 0.36362804040650654
z 1.0
pressure 0.9814407814407814
none 0.5240537240537241
none 7.395360195360196
none 0.0
none 0.0
none 0.0
none 0.0
none 1.0
none 0.0
none 0.0

Which specific tablet model do you have? Does it support tilt?

From your output, I can see that it reports axes with UsagePage=0xd, Usage=0x3d and Usage=0x3e, which according to the USB specification, are supposed to correspond to the tilt axes. If the sliders for that one aren’t moving when you tilt or twist the pen, I’m not sure what we are missing.

I am using the Wacom Intuos S with Bluetooth, it supports tilt and twist.

Here you can see the model
https://www.wacom.com/nl-nl/products/pen-tablets/wacom-intuos

Those two “none” values that are non-zero (the first two below “presure”)–do those not change at all with tilt or twist? They’re the inputs that I’m inclined to suspect might be tilt and twist, just without a recognised name.

Indeed that could be. However those don’t change while I’m using the device either. They are permanently stuck on those values

Very strange. Being stuck at 0 (or even 1.0) would make some sense, but having other values suggests that something, somewhere is being read…

From what I can find, only the Pro model in the Wacom Intuos range supports twist and tilt.

Hello,
I got my hands on a Wacom Pro, and with this I have the following inputs:

x : 0.4195989867854854
y : 0.14853358561967833
z : -0.51953125
pressure : 0.0
none : 1.0014655593551538
none : 2.533952125061065
none : 0.0
none : 0.0
tilt_y : -0.15555555555555556
tilt_x : 0.23333333333333334
inclination : 0.7222222222222222
??? : 0.5916666666666667
none : 0.0

The parameters in bold are those that give values while I’m using the tablet, the others don’t change at all.

I identified the axes that correspond to the tilt_x and tilt_y (their values go from -0.667 to + 0.667 with 0 corresponding to vertical position). I mapped them to angles and the result I get is exactly what I wanted. :slight_smile:

The axis ‘inclination’ seems to me to correspond to the angle from the vertical regardless of its orientation (values from 0.28 to 1 with 1 being vertical, 0.28 being almost horizontal). So to the best of my knowledge, it seems to be redundant.

I haven’t yet managed to understand how the axis with the name ‘???’ works, I’m working on it. I thought it should be related to rotation, but it returns values that are somehow related to the x,y,z coordinates and behave in very unexpected ways. I haven’t found any axis that appears related to the pen rotation.

1 Like