xinput: HUION H420 Pen: XChangeDeviceProperty: data: format questions.

Peter Hutterer peter.hutterer at who-t.net
Tue Jun 15 02:47:49 UTC 2021


On Fri, Jun 11, 2021 at 12:46:59AM -0500, Mike Mestnik wrote:
> Plz redirect me to where I can get assistance with this...
> 
> Hello,
>   Using the xinput cmdline tool I'm fully able to leverage my
> understanding of the HUION H420 Pen and it's properties.  When using
> xfconf-query I don't believe the data is being constructed correctly
> for passing to XChangeDeviceProperty.
> 
> https://gitlab.xfce.org/xfce/xfce4-settings/-/blob/bd2da4ed559eec4144ed8ea6092642deee63de9f/xfsettingsd/pointers.c#L866
> I'm wondering what the format of this buffer should be?
> 
> I'm trying to setup a translation matrix for a tablet(actually the
> pen). In xinput I get `Coordinate Transformation Matrix (157):
> -1.100000, 0.300000, 1.500000, 0.700000, -1.900000, 1.000000,
> 0.000000, 0.000000, 1.000000`, the command issued is `xfconf-query -c
> pointers -p /HUION_H420_Pen_Pen_0/Properties/Coordinate_Transformation_Matrix
> -n -t double -s -1.1 -t double -s 0.2 -t double -s 0.3 -t double -s
> 0.4 -t double -s 1.5 -t double -s 1.6 -t double -s 0.7 -t double -s
> 0.8 -t double -s -1.9` Obviously it looks like xfconf-query's backed
> is expecting two values per cell?  Because of the code in pointers.c
> it's impossible to send more than 9 values, the counts won't match and
> the function returns early.  I therefore think that the buffer's
> format is incorrectly understood.

Don't know anything about xfconf-query but the property format is one float
per array element, but because of historical reasons the array itself must
be longs as you pass it into Xlib. I'll be a 32 bit value on the wire then.
I recommend using XIChangeProperty instead which doesn't have this issue and
XI2 has been around since 2008 now.

See DeviceSetProperty() in xserver/dix/devices.c for the server-side code of
this.

Cheers,
   Peter


More information about the xorg-devel mailing list