[PATCH] Policy: handle `input.touchpad' explicitly

Michael Witten mfwitten at gmail.com
Tue Jan 5 16:53:17 PST 2010

This commit essentially duplicates the policy for:

   <match key="info.capabilities" contains="input.mouse">

and then changes `input.mouse' to `input.touchpad'. This
is necessary because in Linus Torvalds's Linux repo:


the following commit:

    commit 7105d2ea73e1391b681d0e1212c42f561c64d429
    Author: Dmitry Torokhov <dmitry.torokhov at gmail.com>
    Date:   Fri Dec 11 23:54:54 2009 -0800

        Input: ALPS - do not set REL_X/REL_Y capabilities on the touchpad

        Relative events are only reported via secondary device therefore device
        associated with the touchpad should not advertise these capabilities.

        Signed-off-by: Dmitry Torokhov <dtor at mail.ru>

made these few changes:

    diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
    index a3f492a..b03e7e0 100644
    --- a/drivers/input/mouse/alps.c
    +++ b/drivers/input/mouse/alps.c
    @@ -487,6 +487,17 @@ int alps_init(struct psmouse *psmouse)
     	if (alps_hw_init(psmouse))
     		goto init_fail;

    +	/*
    +	 * Undo part of setup done for us by psmouse core since touchpad
    +	 * is not a relative device.
    +	 */
    +	__clear_bit(EV_REL, dev1->evbit);
    +	__clear_bit(REL_X, dev1->relbit);
    +	__clear_bit(REL_Y, dev1->relbit);
    +	/*
    +	 * Now set up our capabilities.
    +	 */
     	dev1->evbit[BIT_WORD(EV_KEY)] |= BIT_MASK(EV_KEY);
     	dev1->keybit[BIT_WORD(BTN_TOUCH)] |= BIT_MASK(BTN_TOUCH);

so that HAL no longer adds:


to an ALPS touchpad's:


so that HAL no longer marks the ALPS touchpad with:

    input.x11_driver = 'evdev'

because the policy file:


doesn't define the policy for:

    <match key="info.capabilities" contains="input.touchpad">

which was previous unnecessary because everything used to
be caught by the policy for:

    <match key="info.capabilities" contains="input.mouse">

Signed-off-by: Michael Witten <mfwitten at gmail.com>
 fdi/policy/10osvendor/10-x11-input.fdi |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/fdi/policy/10osvendor/10-x11-input.fdi b/fdi/policy/10osvendor/10-x11-input.fdi
index cff8fc5..8bbe263 100644
--- a/fdi/policy/10osvendor/10-x11-input.fdi
+++ b/fdi/policy/10osvendor/10-x11-input.fdi
@@ -16,6 +16,14 @@
+    <match key="info.capabilities" contains="input.touchpad">
+      <merge key="input.x11_driver" type="string">mouse</merge>
+      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
+             string="Linux">
+        <merge key="input.x11_driver" type="string">evdev</merge>
+      </match>
+    </match>
     <match key="info.capabilities" contains="input.tablet">
       <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"

More information about the hal mailing list