linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Éric Brunet" <Eric.Brunet@lps.ens.fr>
To: benjamin.tissoires@gmail.com
Cc: jkosina@suse.cz, linux-input@vger.kernel.org, eric.brunet@lps.ens.fr
Subject: Re: Trouble with an HP stylus
Date: Wed, 30 Jul 2014 23:50:15 +0200	[thread overview]
Message-ID: <20140730215015.GA20917@lps.ens.fr> (raw)

Hi!

Thanks for both answers.

To recall the context:

>PRODUCT=3/3eb/840b/111
>NAME="Atmel Atmel maXTouch Digitizer Pen"
>
>Playing with evtest, it appears that the kernel reports the X coordinate
>in ABS_X and in ABS_Y, while the Y coordinate goes into ABS_Z and ABS_RX;
 
> I have already seen this Atmel panel, and the problem was that they used
> twice X then twice Y to report coordinates:
> 
> diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> index 2619f7f..b70d4c3 100644
> --- a/drivers/hid/hid-input.c
> +++ b/drivers/hid/hid-input.c
> @@ -603,7 +603,7 @@ static void hidinput_configure_usage(struct hid_input
> *hidinput, struct hid_fiel if (field->flags & HID_MAIN_ITEM_RELATIVE)
> map_rel(usage->hid & 0xf);
>                         else
> -                               map_abs(usage->hid & 0xf);
> +                               map_abs_clear(usage->hid & 0xf);
>                         break;
> 
>                 case HID_GD_HATSWITCH: 

Yep, this patch helps. It helps a lot. the ABS_X and ABS_Y coordinates are now 
correct, the ABS_Z and ABS_RX coordinates are gone, I can point and click with 
the pen.

However, things do not work totally as expected, and the pen remains unusable 
for many drawing applications. I am not sure if the problem lies in the 
input/hid system, or in Xorg's evdev driver or in the applications, but the 
problem I am about to describe occurs only with the pen: everything works as 
expected with the touchpad (recognized as a simple mouse) or with the finger on 
the touchscreen:
  * when I try to make annotations with okular with the "draw a freehand line" 
tool, the line I draw with the pen jumps (drawing a straight line) to some 
apparently random point outside okular's window and jumps back (drawing 
another straight line) to where the pen is, several times per second. I don't 
want to send a jpg to the whole mailing list, but I can send a snapshot on a 
private email on request.
  * when I try to use a drawing tool with gimp or mypaint, each time I raise
the pen and put it at some other place to make another drawing, a straight line 
is drawn between the last and the new position of the pen.

Here is what happens on evtest if I touch the screen with the pen, move a
bit and stops touching; I didn't see anything suspicious, except maybe that 
sometimes there is a single ABS_X or a single ABS_Y without the other 
coordinate between two SYN_REPORT.

Event: time 1406710046.690615, type 1 (EV_KEY), code 320 (BTN_TOOL_PEN), value 1
Event: time 1406710046.690615, type 3 (EV_ABS), code 0 (ABS_X), value 3279
Event: time 1406710046.690615, type 3 (EV_ABS), code 1 (ABS_Y), value 2555
Event: time 1406710046.690615, -------------- SYN_REPORT ------------
Event: time 1406710046.697616, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042
Event: time 1406710046.697616, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1406710046.697616, -------------- SYN_REPORT ------------
Event: time 1406710046.713550, type 3 (EV_ABS), code 0 (ABS_X), value 3287
Event: time 1406710046.713550, type 3 (EV_ABS), code 1 (ABS_Y), value 2539
[ Many other EV_ABS events]
Event: time 1406710047.317556, type 3 (EV_ABS), code 0 (ABS_X), value 3755
Event: time 1406710047.317556, type 3 (EV_ABS), code 1 (ABS_Y), value 1699
Event: time 1406710047.317556, -------------- SYN_REPORT ------------
Event: time 1406710047.340556, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042
Event: time 1406710047.340556, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1406710047.340556, -------------- SYN_REPORT ------------
Event: time 1406710047.342504, type 1 (EV_KEY), code 320 (BTN_TOOL_PEN), value 0
Event: time 1406710047.342504, -------------- SYN_REPORT ------------

Thanks again for the patch,

        Éric Brunet
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2014-07-30 22:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30 21:50 Éric Brunet [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-07-24 15:52 Trouble with an HP stylus Éric Brunet
2014-07-29  9:50 ` Jiri Kosina
2014-07-29 14:41   ` Jiri Kosina
2014-07-29 14:45   ` Benjamin Tissoires

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=20140730215015.GA20917@lps.ens.fr \
    --to=eric.brunet@lps.ens.fr \
    --cc=benjamin.tissoires@gmail.com \
    --cc=jkosina@suse.cz \
    --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;
as well as URLs for NNTP newsgroup(s).