Linux Input/HID development
 help / color / mirror / Atom feed
From: Nuno Santos <nsantos@displax.com>
To: linux-input@vger.kernel.org
Subject: Question regarding multitouch input on Linux kernel
Date: Mon, 25 Feb 2013 15:00:32 +0000	[thread overview]
Message-ID: <512B7C90.4010704@displax.com> (raw)

Hi,

I have been experiencing an issue with a Linux driver for multitouch 
input that i'm responsible for maintaining.

The issue is basically the following:

- I load the driver and the mouse works just fine
- I touch the screen and the first touch input is delivered to the system
- On that very same moment I can't use mouse left button down to click 
on folders on nautilus. I can only selected them using drag select. I 
also can't get a folder to get selected with a single touch input.
- The user experience with the mouse gets inconsistent.
- Unloading the module doesn't return the good experience
- Restarting X fixes the problem until I report a touch input again with 
this driver
- If I only use common pointer input, the issue doesn't occur.

My questions resides in if the problem is due to bad touch reporting, or 
due to a bug in X/nautilus.

I have been analyzing a lot of examples under kernel tree for multitouch 
input under Linux an it seems I'm doing what is necessary.

I'm using Ubuntu 12.04 but this happened with Ubuntu 11.XX already

This what I do in order to declare device capabilities:

input_set_abs_params(input_dev, ABS_X, 0, 6300, 0, 0);
input_set_abs_params(input_dev, ABS_Y, 0, 6300, 0, 0);

input_mt_init_slots(input_dev, DPX_TOUCH_MAX_COUNT);
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);

This is what I do in order to report touches:

for (currentTouch=0;currentTouch<DPX_TOUCH_MAX_COUNT && 
touchCount<priv->context->State.Acquisition.TouchPoints;++currentTouch)
     {
         Touch = priv->context->State.Touches + currentTouch;

         x = Touch->CalibratedPoint.Position.X;
         y = Touch->CalibratedPoint.Position.Y;

         input_mt_slot(usbtouch->input, currentTouch);

         // touch down
         if(Touch->CurrentState==DPX_TOUCH_STATE_ACTIVE && 
Touch->ReportedState==DPX_TOUCH_STATE_INACTIVE)
         {
             Touch->ReportedState = DPX_TOUCH_STATE_ACTIVE;

             input_mt_report_slot_state(usbtouch->input, MT_TOOL_FINGER, 1);

             input_report_abs(usbtouch->input, ABS_MT_POSITION_X, x);
             input_report_abs(usbtouch->input, ABS_MT_POSITION_Y, y);

             touchCount++;
         }
         // touch move
         else if (Touch->CurrentState==DPX_TOUCH_STATE_ACTIVE && 
Touch->ReportedState==DPX_TOUCH_STATE_ACTIVE)
         {
             Touch->ReportedState = DPX_TOUCH_STATE_ACTIVE;

             input_mt_report_slot_state(usbtouch->input, MT_TOOL_FINGER, 1);

             input_report_abs(usbtouch->input, ABS_MT_POSITION_X, x);
             input_report_abs(usbtouch->input, ABS_MT_POSITION_Y, y);

             touchCount++;
         }
         // touch up
         else
         {
             Touch->ReportedState = DPX_TOUCH_STATE_INACTIVE;

             input_mt_report_slot_state(usbtouch->input, MT_TOOL_FINGER, 0);

             input_report_abs(usbtouch->input, ABS_MT_POSITION_X, x);
             input_report_abs(usbtouch->input, ABS_MT_POSITION_Y, y);

             touchCount++;
         }
     }

     if (touchCount>0)
     {
         input_mt_report_pointer_emulation(usbtouch->input, true);
         input_sync(usbtouch->input);
     }


Thanks for your attention,

With my best regards,

Nuno Santos


             reply	other threads:[~2013-02-25 15:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-25 15:00 Nuno Santos [this message]
2013-02-25 15:31 ` Question regarding multitouch input on Linux kernel Benjamin Tissoires
2013-02-25 15:44   ` Nuno Santos
2013-02-25 15:56     ` Benjamin Tissoires
2013-02-25 15:59       ` Nuno Santos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=512B7C90.4010704@displax.com \
    --to=nsantos@displax.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox