Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm developing a linux kernel driver for a multitouch device. I have used as start point the usbtouchscreen driver included in linux-3.0 kernel source.

Altough I can already make my mouse pointer move with touch there still a lot of questions that still arise:

  • When properly configured will xinput list my device as mulitouch device ou touchscreen? The only thing I got so far was listed in Virtual Core Pointer category

  • How should I properly configure and setup input device? This is how I am making:

/* For single touch */
input_set_abs_params(input_dev, ABS_X, 0, 6300, 0, 0);
input_set_abs_params(input_dev, ABS_Y, 0, 6300, 0, 0);

/* For multi-touch */
input_mt_init_slots(input_dev, 6);
input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, 0xff, 0, 0);
input_set_abs_params(input_dev, ABS_MT_POSITION_X, 0, 6300, 0, 0);
input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 0, 6300, 0, 0);

  • How should I properly inject touches? In linux multitouch input protocol it says the following:

The protocol is divided into two types, depending on the capabilities of the hardware. -For devices handling anonymous contacts (type A), the protocol describes how to send the raw data for all contacts to the receiver. For devices capable of tracking identifiable contacts (type B), the protocoldescribes how to send updates for individual contacts via event slots.

What means anonymous contacts? My device sends raw data and my tracking is made on the kernel. By the time I'm about to inject touches in the kernel subsystem I have already touches identified and tracked. What is after all my device type?

Regardless, I have already tried the two types of reporting and non seem to give me multitouch input. This is how i'm doing right now:

    input_mt_slot(usbtouch->input, Touch->Id);
    input_mt_report_slot_state(usbtouch->input, MT_TOOL_FINGER, true);

   input_report_abs(usbtouch->input, ABS_MT_TOUCH_MAJOR, 128);
   input_report_abs(usbtouch->input, ABS_MT_POSITION_X, Touch->ReportedPosition.X);
   input_report_abs(usbtouch->input, ABS_MT_POSITION_Y, Touch->ReportedPosition.Y);


if (touch>0)
    input_report_key(usbtouch->input, BTN_TOUCH, true);

    input_report_abs(usbtouch->input, ABS_X, Touch->ReportedPosition.X);
    input_report_abs(usbtouch->input, ABS_Y, Touch->ReportedPosition.Y);

  • How can I test user side multitouch input? I'm trying to see if xinput lists my device as a multitouch device. No success. I'm also trying an example from qt4-demos, finger paint which always gives me nothing. Is there any "oficial" tool for ubuntu multitouch input testing?
share|improve this question

closed as not a real question by Bruno Pereira Mar 12 '12 at 20:25

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

These are three question in one. Maybe it would be better to split it into three questions. – txwikinger Nov 9 '11 at 12:49
It is preferred if you can post separate questions instead of combining your questions into one. That way, it helps the people answering your question and also others hunting for at least one of your questions. the FAQ on asking questions.Regards, – Ringtail Mar 12 '12 at 18:17