[PATCH] Correctly identify touchpads (Was Re: inputattach, upstream and lshal ?)

Dmitry Torokhov dmitry.torokhov at gmail.com
Tue Nov 3 10:16:30 PST 2009


On Tue, Nov 03, 2009 at 12:11:57PM +0100, Tias wrote:
> On Mon, Nov 02, 2009 at 08:31:39PM -0800, Dmitry Torokhov wrote:
> > Hi Tias,
> > 
> > On Sun, Oct 25, 2009 at 10:56:56PM +0100, Tias wrote:
> > > Dmitry Torokhov wrote:
> > >> On Sun, Oct 25, 2009 at 05:20:31PM +0100, Tias wrote:
> > >>>
> > >>>
> > >>> So my questions is: is it possible for inputattach in case of a   
> > >>> touchscreen to set:
> > >>>   info.capabilities = {'input', 'button', 'input.touchscreen'} 
> > >>> (string  list)
> > >>>
> > >>> This way the evdev driver would automatically correctly be loaded for 
> > >>>  all touchscreens.
> > >>
> > >> This is not the task of inputattach but rather HAL misidentifying the
> > >> device:
> > >>
> > >> 		if (test_bit (BTN_TOUCH, bitmask_key)) {
> > >> 			hal_device_add_capability (d, "input.touchpad");
> > >> 			goto out;
> > >> 		}
> > >>
> > >> but it should be doing the test for BTN_TOOL_FINGER instead.
> > >
> > > Ah, OK.
> > > I'm not sure where you found that code.
> > 
> > It is at:
> > 
> > 	git://www.freedesktop.org/hal
> > 
> > but I am not sure if they are taking any patches since they are trying
> > to deprecate HAL in favor of DeviceKit and other...
> > 
> > > Do you have an idea for a patch  
> > > or should we send a bugreport somewhere ?
> > >
> > 
> > Something like below should work, I think.
> > 
> > -- 
> > Dmitry
> > 
> > 
> > From: Dmitry Torokhov <dmitry.torokhov at gmail.com>
> > Subject: [PATCH] Correctly identify touchpads
> > 
> > BTN_TOUCH (as well as ABS_PRESSURE) is used not only by touchpads but
> > by touchscreens as well. The proper ceck for a touchpad is presence
> > of BTN_TOOL_FINGER and absence of BTN_TOOL_PEN (the latter to filter
> > out some tablets that use BTN_TOOL_FINGER).
> > 
> > Tablet matching should be on either BTN_TOOL_PEN or BTN_STULYS.
> 
> Aha, this is a nice explanation of how capability detection for
> touchpads and tablets should be done. Judging from the code in git
> though, there is no capability detection for "input.touchscreen" yet.
> Should this be something like BTN_TOUCH && !BTN_TOOL_FINGER ?
> 

Given how the code is organized I think just testing for BTN_TOUCH will
leave us with touchscreens. But in general you are correct,
BTN_TOUCH && !BTN_TOOL_FINGER should give you touchscreens.

-- 
Dmitry


More information about the hal mailing list