ABS_MT_POSITION_X and Y counted more than once when multi-touching

Leslie Zhai xiangzhai83 at gmail.com
Sun Jul 28 18:24:24 PDT 2013


Hi Peter,

Thanks for your reply :) I have fixed my issue 
https://bugs.launchpad.net/ubuntu/+source/mtdev/+bug/1205361/comments/2

Actually I forgot to read the MT protocol doc what a shame :|
> Hi Leslie,
>
> On Sat, Jul 27, 2013 at 11:16:53AM +0800, Leslie Zhai wrote:
>> Hi xf86-input-evdev developers,
>>
>> I use mtdev "read_mtdev.cpp" in test.tar.bz2
>> https://www.dropbox.com/s/43jp0yl0avf9i3p/test.tar.bz2 to get
>> ABS_MT_POSITION_X and ABS_MT_POSITION_Y sample "2s_zoom_in_sample.txt"
>> in the same tarball for each ABS_MT_SLOT when multi-touching.
> apologies, but I don't think you'll find many on this list who'll download
> some random tarball and start debugging your program (mainly a time issue
> too). So don't expect too much here.
>
>> You can use scons http://www.scons.org to build the test case.
>> "sample_slot.cpp" use Vtk http://www.vtk.org to render plot chart, you
>> might need to install libvtk.
> .. especially if it requires more than just a simple compile step.
>
>   
>> But ABS_MT_POSITION_X and Y counted more than once for each slot
>> "sample_plot.cpp", the plot chart shown as "2slots_zoom_in.png".
>>
>> When ./sample_plot 2s_zoom_in_sample.txt 0
>> to only show slot[0] as "slot0_zoom_in.png", there are three blue lines,
>> but instead should be only one.
>>
>> When ./sample_plot 2s_zoom_in_sample.txt 1
>> to only show slot[1] as "slot1_zoom_in.png", there are also three red
>> lines, but instead should be only one too.
>>
>> My question is whether or not I process the ABS_MT_POSITION_X and Y for
>> EV_ABS motion event type in "m_process_absolute_motion_event" uncorrectly?
>> I read the source code "xf86-input-evdev"
>> http://cgit.freedesktop.org/xorg/driver/xf86-input-evdev/tree/src/evdev.c
>> It mentioned that
>>
>> |MT axes are counted twice - once as ABS_X (which the kernel keeps for
>> backwards compatibility), once as ABS_MT_POSITION_X. So we need to keep a
>> mapping of those axes to make sure we only count them once|
> this is a X-specific issue. a device can only have one x and one y axis in
> X, with the MT support it may have two (ABS_X and ABS_MT_POSITION_X). We
> need to map them accordingly so that events from both are sent through the
> same X axis (though we ignore ABS_X for MT devices).
>
> it most certainly won't apply to your program - whatever it does. you can
> just ignore the ABS_X/Y coordinates and got for the MT ones only. other
> than that you most likely don't get more than one axis per slot, unless your
> device is broken. note that once the slot is set, future events for this
> slot won't be preceded by an ABS_MT_SLOT event. maybe that's what you're
> seeing as duplicate events?
>
> Cheers,
>     Peter
>
>   
>> It means I have to filter or remove some _X and _Y from the sample ?
>> HOWTO : other issue;
>>
>> You can use scons http://www.scons.org to build the test case.
>> "sample_slot.cpp" use Vtk http://www.vtk.org to render plot chart, you
>> might need to install libvtk.
>>
>> Many thanks!



More information about the xorg-devel mailing list