Wacom Tablet Valuators

I am using Psychtoolbox 3.0.16 on Ubuntu 18.04.14 with Matlab R2020a

I am trying to do a simple tracing task on a Wacom 22HD tablet, with code very similar to MouseTraceDemo2 to draw on screen and obtain stylus location:

while drawing 
        [x,y,touch,~,val{seg},valinfo] = GetMouse(wdwprop.window); 
        t=GetSecs;

        if ~touch(1) %stopped drawing
            drawing=false;
        
        else % still drawing, continue line
            
            if x ~= Xpos || y ~= Ypos %store if mouse moved
                time{seg}= [time{seg} t-start];
                points{seg} = [points{seg} ; x y]; 
                [numPoints, ~]=size(points{seg});

            % draw the most recent line segment
                if feedback
                    Screen(wdwprop.window,'DrawLine',128,points{seg}(numPoints-1,1),points{seg}(numPoints-1,2),points{seg}(numPoints,1),points{seg}(numPoints,2));
                    % add new segment without clearing, don't wait for refresh reduces lag
                    Screen('Flip', wdwprop.window, 0, 1, 2);
                end
                Xpos=x; Ypos=y;
            end
        end                
    end

When I have the Wacom display in mirroring mode and request only X,Y coordinates from the default mouse using GetMouse this works fine. However, if I add valuators to the GetMouse output there is an error due to valuators not being assigned on that mouse.

When I change the GetMouse device in the code to the stylus (see below) it doesn’t seem to register touches at all despite the wacom tablet LED responding to the touch.

[x,y,touch,~,val,valinfo] = GetMouse(wdwprop.window,7); 

The outputs from GetMouseIndices are:

name = 
    {'Virtual core pointer'          } 
    {'Virtual core XTEST pointer'    }
    {'Wacom Cintiq 22HD Pen stylus'  }
    {'Wacom Cintiq 22HD Pad pad'     }
    {'DELL09BD:00 0488:120A Touchpad'}
    {'PS/2 Generic Mouse'            }
    {'Wacom Cintiq 22HD Pen eraser'  }

info{3}=
  struct with fields: 

     usagePageValue: 1
         usageValue: 2
          usageName: 'slave pointer'
              index: 7
          transport: 'enabled'
           vendorID: []
          productID: []
            version: []
       manufacturer: []
            product: 'Wacom Cintiq 22HD Pen stylus'
       serialNumber: []
         locationID: 2
        interfaceID: 9
      totalElements: 262
           features: 8
             inputs: 262
            outputs: 0
        collections: 0
               axes: 6
            buttons: 256
               hats: 0
            sliders: 0
              dials: 0
             wheels: 0
    touchDeviceType: -1
     maxTouchpoints: -1

I’m not sure what is wrong with this approach? Any help would be much appreciated!

Another question regarding using the Wacom tablet – is it possible to use as second device using the XOrgConfigSelector? When I try to set it up as a second monitor, it works ok visually but the calibration (location of touches) is off. Using the linux calibration the targets show up on the primary (laptop) screen not the touchscreen so cannot calibrate the second monitor.
What is the best way to set up the Wacom display for use with Psychtoolbox? I see several references in function helps to Wacom but have had trouble finding any information about how best to set up the hardware.

Many thanks in advance for any suggestions.

Katy

Are you sure that the whole touch variable contains all zeros? You only test touch(1) in your script, but maybe that’s not the right location.

Thanks for the response – I did just double check and the entire touch variable is empty, so although a good point that doesn’t seem to be the issue!

Peculiar. What if you query the “Virtual core pointer” device instead, ie. query with GetMouseIndices('masterPointer') ?

This seems to have solved the pen input problem! Thank you.

One other quesiton regarding the Wacom is whether I can use it as a second monitor. Currently I have only figured out how to get it to work in mirroring mode, as when I set it up as a second monitor using XOrgConfigSelector the calibration (location of touches) is off. Using the linux calibration the targets show up on the primary (laptop) screen not the touchscreen so cannot calibrate the second monitor.

Good.

What calibration tool do you use? In principle it should be possible, but many tools are not aware of multi-x-screen, so they need a little hand-holding.