From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Henrik Rydberg <rydberg@euromail.se>
Cc: Jiri Kosina <jkosina@suse.cz>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] input: mt: Add pressure to pointer emulation code
Date: Mon, 29 Nov 2010 01:47:15 -0800 [thread overview]
Message-ID: <20101129094715.GA9303@core.coreip.homeip.net> (raw)
In-Reply-To: <1291014802-17061-5-git-send-email-rydberg@euromail.se>
On Mon, Nov 29, 2010 at 08:13:22AM +0100, Henrik Rydberg wrote:
> Some MT devices report pressure per contact. This patch adds
> ABS_PRESSURE to the pointer emulation code.
>
> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
> ---
> drivers/input/input-mt.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
> index 08aa682..49ccd15 100644
> --- a/drivers/input/input-mt.c
> +++ b/drivers/input/input-mt.c
> @@ -97,7 +97,8 @@ EXPORT_SYMBOL(input_mt_report_slot_state);
> * input_mt_report_pointer_emulation() - common pointer emulation
> * @dev: input device with allocated MT slots
> *
> - * Performs legacy pointer emulation via BTN_TOUCH, ABS_X and ABS_Y.
> + * Performs legacy pointer emulation via BTN_TOUCH, ABS_X, ABS_Y and
> + * ABS_PRESSURE.
> */
> void input_mt_report_pointer_emulation(struct input_dev *dev)
> {
> @@ -124,9 +125,13 @@ void input_mt_report_pointer_emulation(struct input_dev *dev)
> if (oldest) {
> int x = input_mt_get_value(oldest, ABS_MT_POSITION_X);
> int y = input_mt_get_value(oldest, ABS_MT_POSITION_Y);
> + int p = input_mt_get_value(oldest, ABS_MT_PRESSURE);
What if device does not report ABS_MT_PRESSURE/ABS_PRESSURE? Do we rely
on input core to suppress unsupported events? A comment would be nice...
Also, is there a gelper to set up pointer emulation capabilities for MT
device?
>
> input_event(dev, EV_ABS, ABS_X, x);
> input_event(dev, EV_ABS, ABS_Y, y);
> + input_event(dev, EV_ABS, ABS_PRESSURE, p);
> + } else {
> + input_event(dev, EV_ABS, ABS_PRESSURE, 0);
> }
> }
> EXPORT_SYMBOL(input_mt_report_pointer_emulation);
> --
> 1.7.1
>
--
Dmitry
next prev parent reply other threads:[~2010-11-29 9:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-29 7:13 [PATCH 0/4] input: mt: Driver interface simplifications Henrik Rydberg
2010-11-29 7:13 ` [PATCH 1/4] input: mt: Break out slots handling Henrik Rydberg
2010-11-29 7:13 ` [PATCH 2/4] input: mt: Collect slots initialization code Henrik Rydberg
2010-11-29 7:13 ` [PATCH 3/4] input: mt: Move tracking and pointer emulation to input-mt Henrik Rydberg
2010-11-30 21:50 ` Henrik Rydberg
2010-11-29 7:13 ` [PATCH 4/4] input: mt: Add pressure to pointer emulation code Henrik Rydberg
2010-11-29 9:47 ` Dmitry Torokhov [this message]
2010-11-29 11:20 ` Henrik Rydberg
2010-11-30 9:09 ` Dmitry Torokhov
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=20101129094715.GA9303@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rydberg@euromail.se \
/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).