2011-02-25 05:19:34

by Keng-Yü Lin

[permalink] [raw]
Subject: [PATCH] eeepc-wmi: set the touchpad toggle key code to F21

Signed-off-by: Keng-Yu Lin <[email protected]>
---
drivers/platform/x86/eeepc-wmi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

https://bugs.freedesktop.org/show_bug.cgi?id=31333

diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index d399775..da00cbc 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -113,7 +113,7 @@ static const struct key_entry eeepc_wmi_keymap[] = {
{ KE_KEY, 0x32, { KEY_MUTE } },
{ KE_KEY, 0x5c, { KEY_F15 } }, /* Power Gear key */
{ KE_KEY, 0x5d, { KEY_WLAN } },
- { KE_KEY, 0x6b, { KEY_F13 } }, /* Disable Touchpad */
+ { KE_KEY, 0x6b, { KEY_F21 } }, /* Disable Touchpad */
{ KE_KEY, 0x82, { KEY_CAMERA } },
{ KE_KEY, 0x83, { KEY_CAMERA_ZOOMIN } },
{ KE_KEY, 0x88, { KEY_WLAN } },
--
1.7.1


2011-02-25 06:52:14

by Corentin Chary

[permalink] [raw]
Subject: Re: [PATCH] eeepc-wmi: set the touchpad toggle key code to F21

On Fri, Feb 25, 2011 at 6:19 AM, Keng-Yu Lin <[email protected]> wrote:
> Signed-off-by: Keng-Yu Lin <[email protected]>
> ---
>  drivers/platform/x86/eeepc-wmi.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> https://bugs.freedesktop.org/show_bug.cgi?id=31333
>
> diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
> index d399775..da00cbc 100644
> --- a/drivers/platform/x86/eeepc-wmi.c
> +++ b/drivers/platform/x86/eeepc-wmi.c
> @@ -113,7 +113,7 @@ static const struct key_entry eeepc_wmi_keymap[] = {
>        { KE_KEY, 0x32, { KEY_MUTE } },
>        { KE_KEY, 0x5c, { KEY_F15 } }, /* Power Gear key */
>        { KE_KEY, 0x5d, { KEY_WLAN } },
> -       { KE_KEY, 0x6b, { KEY_F13 } }, /* Disable Touchpad */
> +       { KE_KEY, 0x6b, { KEY_F21 } }, /* Disable Touchpad */
>        { KE_KEY, 0x82, { KEY_CAMERA } },
>        { KE_KEY, 0x83, { KEY_CAMERA_ZOOMIN } },
>        { KE_KEY, 0x88, { KEY_WLAN } },

Hum, I'm not very comfortable with this patch now that we got
KEY_TOUCHPAD_TOGGLE.
I know, it doesn't work with current Xorg, but if we continue to
workaround that, it'll never be fixed.

Dmitry, Matthew, any advice ?
--
Corentin Chary
http://xf.iksaif.net

2011-02-25 07:18:39

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH] eeepc-wmi: set the touchpad toggle key code to F21

On Fri, Feb 25, 2011 at 07:52:11AM +0100, Corentin Chary wrote:
> On Fri, Feb 25, 2011 at 6:19 AM, Keng-Yu Lin <[email protected]> wrote:
> > Signed-off-by: Keng-Yu Lin <[email protected]>
> > ---
> > ?drivers/platform/x86/eeepc-wmi.c | ? ?2 +-
> > ?1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > https://bugs.freedesktop.org/show_bug.cgi?id=31333
> >
> > diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
> > index d399775..da00cbc 100644
> > --- a/drivers/platform/x86/eeepc-wmi.c
> > +++ b/drivers/platform/x86/eeepc-wmi.c
> > @@ -113,7 +113,7 @@ static const struct key_entry eeepc_wmi_keymap[] = {
> > ? ? ? ?{ KE_KEY, 0x32, { KEY_MUTE } },
> > ? ? ? ?{ KE_KEY, 0x5c, { KEY_F15 } }, /* Power Gear key */
> > ? ? ? ?{ KE_KEY, 0x5d, { KEY_WLAN } },
> > - ? ? ? { KE_KEY, 0x6b, { KEY_F13 } }, /* Disable Touchpad */
> > + ? ? ? { KE_KEY, 0x6b, { KEY_F21 } }, /* Disable Touchpad */
> > ? ? ? ?{ KE_KEY, 0x82, { KEY_CAMERA } },
> > ? ? ? ?{ KE_KEY, 0x83, { KEY_CAMERA_ZOOMIN } },
> > ? ? ? ?{ KE_KEY, 0x88, { KEY_WLAN } },
>
> Hum, I'm not very comfortable with this patch now that we got
> KEY_TOUCHPAD_TOGGLE.
> I know, it doesn't work with current Xorg, but if we continue to
> workaround that, it'll never be fixed.
>
> Dmitry, Matthew, any advice ?

I believe that the kernel should use KEY_TOUCHPAD_TOGGLE and userspace
should use udev's key re-mapping facilities while X is unable to process
keycodes above 255 to adjust to the keycode du jour. If all kernel
drivers were to use KEY_TOUCHPAD_TOGGLE then remapping would be much
easier (the utility would simply check capabilities for
KEY_TOUCHPAD_TOGGLE and do the remap).

Thanks.

--
Dmitry

2011-02-25 09:23:07

by Keng-Yü Lin

[permalink] [raw]
Subject: Re: [PATCH] eeepc-wmi: set the touchpad toggle key code to F21

On Fri, Feb 25, 2011 at 3:18 PM, Dmitry Torokhov
<[email protected]> wrote:
> I believe that the kernel should use KEY_TOUCHPAD_TOGGLE and userspace
> should use udev's key re-mapping facilities while X is unable to process
> keycodes above 255 to adjust to the keycode du jour. If all kernel
> drivers were to use KEY_TOUCHPAD_TOGGLE then remapping would be much
> easier (the utility would simply check capabilities for
> KEY_TOUCHPAD_TOGGLE and do the remap).

Can udev re-map a key code to another?

Am I correct that udev can only re-map a scan code to a specified key code.

2011-02-25 09:33:41

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH] eeepc-wmi: set the touchpad toggle key code to F21

On Fri, Feb 25, 2011 at 05:22:43PM +0800, Keng-Y? Lin wrote:
> On Fri, Feb 25, 2011 at 3:18 PM, Dmitry Torokhov
> <[email protected]> wrote:
> > I believe that the kernel should use KEY_TOUCHPAD_TOGGLE and userspace
> > should use udev's key re-mapping facilities while X is unable to process
> > keycodes above 255 to adjust to the keycode du jour. If all kernel
> > drivers were to use KEY_TOUCHPAD_TOGGLE then remapping would be much
> > easier (the utility would simply check capabilities for
> > KEY_TOUCHPAD_TOGGLE and do the remap).
>
> Can udev re-map a key code to another?

Not directly.

>
> Am I correct that udev can only re-map a scan code to a specified key code.

Right, so once you determined via capabilities that device emits
KEY_TOUCHPAD_TOGGLE you query the keymap (using EVIOCGKEYCODE2; by
index) and replace all entries that are mapped to KEY_TOUCHPAD_TOGGLE to
whatever you want.

Thanks.

--
Dmitry

2011-02-25 10:02:18

by Martin Pitt

[permalink] [raw]
Subject: Re: [PATCH] eeepc-wmi: set the touchpad toggle key code to F21

Keng-Y? Lin [2011-02-25 17:22 +0800]:
> Can udev re-map a key code to another?

Not directly, as udev itself doesn't actually process the input
events. It just pokes the scan code -> keycode map into the kernel.

What it can do is to re-map an existing key (scan code) to a different
key code, which provides the same effect in most cases.

Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (http://www.ubuntu.com) | Debian Developer (http://www.debian.org)

2011-02-25 14:12:54

by Matthew Garrett

[permalink] [raw]
Subject: Re: [PATCH] eeepc-wmi: set the touchpad toggle key code to F21

On Fri, Feb 25, 2011 at 07:52:11AM +0100, Corentin Chary wrote:

> Hum, I'm not very comfortable with this patch now that we got
> KEY_TOUCHPAD_TOGGLE.
> I know, it doesn't work with current Xorg, but if we continue to
> workaround that, it'll never be fixed.
>
> Dmitry, Matthew, any advice ?

Yeah, I'd go with Dmitry's idea for now.

--
Matthew Garrett | [email protected]

2011-02-25 15:14:09

by Chris Bagwell

[permalink] [raw]
Subject: Re: [PATCH] eeepc-wmi: set the touchpad toggle key code to F21

On Fri, Feb 25, 2011 at 1:18 AM, Dmitry Torokhov
<[email protected]> wrote:
> On Fri, Feb 25, 2011 at 07:52:11AM +0100, Corentin Chary wrote:
>> On Fri, Feb 25, 2011 at 6:19 AM, Keng-Yu Lin <[email protected]> wrote:
>> > Signed-off-by: Keng-Yu Lin <[email protected]>
>> > ---
>> > ?drivers/platform/x86/eeepc-wmi.c | ? ?2 +-
>> > ?1 files changed, 1 insertions(+), 1 deletions(-)
>> >
>> > https://bugs.freedesktop.org/show_bug.cgi?id=31333
>> >
>> > diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
>> > index d399775..da00cbc 100644
>> > --- a/drivers/platform/x86/eeepc-wmi.c
>> > +++ b/drivers/platform/x86/eeepc-wmi.c
>> > @@ -113,7 +113,7 @@ static const struct key_entry eeepc_wmi_keymap[] = {
>> > ? ? ? ?{ KE_KEY, 0x32, { KEY_MUTE } },
>> > ? ? ? ?{ KE_KEY, 0x5c, { KEY_F15 } }, /* Power Gear key */
>> > ? ? ? ?{ KE_KEY, 0x5d, { KEY_WLAN } },
>> > - ? ? ? { KE_KEY, 0x6b, { KEY_F13 } }, /* Disable Touchpad */
>> > + ? ? ? { KE_KEY, 0x6b, { KEY_F21 } }, /* Disable Touchpad */
>> > ? ? ? ?{ KE_KEY, 0x82, { KEY_CAMERA } },
>> > ? ? ? ?{ KE_KEY, 0x83, { KEY_CAMERA_ZOOMIN } },
>> > ? ? ? ?{ KE_KEY, 0x88, { KEY_WLAN } },
>>
>> Hum, I'm not very comfortable with this patch now that we got
>> KEY_TOUCHPAD_TOGGLE.
>> I know, it doesn't work with current Xorg, but if we continue to
>> workaround that, it'll never be fixed.
>>
>> Dmitry, Matthew, any advice ?
>
> I believe that the kernel should use KEY_TOUCHPAD_TOGGLE and userspace
> should use udev's key re-mapping facilities while X is unable to process
> keycodes above 255 to adjust to the keycode du jour. If all kernel
> drivers were to use KEY_TOUCHPAD_TOGGLE then remapping would be much
> easier (the utility would simply check capabilities for
> KEY_TOUCHPAD_TOGGLE and do the remap).

I submitted last month a patch to udev to do the scancode-to-F21
mapping. So that part should be covered for near term.

I also agree if we are going to change kernel side, we should change
to KEY_TOUCHPAD_TOGGLE in both eeepc-laptop and eeepc-wmi.

http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=0d8b6be5f5238360d2d8e220d6da280f842c5358

Chris

2011-02-25 22:25:47

by Joey Lee

[permalink] [raw]
Subject: Re: [PATCH] eeepc-wmi: set the touchpad toggle key code to F21

於 五,2011-02-25 於 09:14 -0600,Chris Bagwell 提到:
> On Fri, Feb 25, 2011 at 1:18 AM, Dmitry Torokhov
> <[email protected]> wrote:
> > On Fri, Feb 25, 2011 at 07:52:11AM +0100, Corentin Chary wrote:
> >> On Fri, Feb 25, 2011 at 6:19 AM, Keng-Yu Lin <[email protected]> wrote:
> >> > Signed-off-by: Keng-Yu Lin <[email protected]>
> >> > ---
> >> > drivers/platform/x86/eeepc-wmi.c | 2 +-
> >> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >> >
> >> > https://bugs.freedesktop.org/show_bug.cgi?id=31333
> >> >
> >> > diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
> >> > index d399775..da00cbc 100644
> >> > --- a/drivers/platform/x86/eeepc-wmi.c
> >> > +++ b/drivers/platform/x86/eeepc-wmi.c
> >> > @@ -113,7 +113,7 @@ static const struct key_entry eeepc_wmi_keymap[] = {
> >> > { KE_KEY, 0x32, { KEY_MUTE } },
> >> > { KE_KEY, 0x5c, { KEY_F15 } }, /* Power Gear key */
> >> > { KE_KEY, 0x5d, { KEY_WLAN } },
> >> > - { KE_KEY, 0x6b, { KEY_F13 } }, /* Disable Touchpad */
> >> > + { KE_KEY, 0x6b, { KEY_F21 } }, /* Disable Touchpad */
> >> > { KE_KEY, 0x82, { KEY_CAMERA } },
> >> > { KE_KEY, 0x83, { KEY_CAMERA_ZOOMIN } },
> >> > { KE_KEY, 0x88, { KEY_WLAN } },
> >>
> >> Hum, I'm not very comfortable with this patch now that we got
> >> KEY_TOUCHPAD_TOGGLE.
> >> I know, it doesn't work with current Xorg, but if we continue to
> >> workaround that, it'll never be fixed.
> >>
> >> Dmitry, Matthew, any advice ?
> >
> > I believe that the kernel should use KEY_TOUCHPAD_TOGGLE and userspace
> > should use udev's key re-mapping facilities while X is unable to process
> > keycodes above 255 to adjust to the keycode du jour. If all kernel
> > drivers were to use KEY_TOUCHPAD_TOGGLE then remapping would be much
> > easier (the utility would simply check capabilities for
> > KEY_TOUCHPAD_TOGGLE and do the remap).
>
> I submitted last month a patch to udev to do the scancode-to-F21
> mapping. So that part should be covered for near term.
>
> I also agree if we are going to change kernel side, we should change
> to KEY_TOUCHPAD_TOGGLE in both eeepc-laptop and eeepc-wmi.
>
> http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=0d8b6be5f5238360d2d8e220d6da280f842c5358
>

Found acer-wmi also have Touchpad toggle but mapping to F22

{KE_KEY, 0x82, {KEY_F22} }, /* Touch Pad On/Off */

Will also send patch to udev keymap first, then change the wmi driver
mapping to KEY_TOUCHPAD_TOGGLE.


Thank's
Joey Lee

2011-03-01 03:29:37

by Keng-Yü Lin

[permalink] [raw]
Subject: Re: [PATCH] eeepc-wmi: set the touchpad toggle key code to F21

On Fri, Feb 25, 2011 at 11:14 PM, Chris Bagwell <[email protected]> wrote:
>
> I submitted last month a patch to udev to do the scancode-to-F21
> mapping.  So that part should be covered for near term.
>
> I also agree if we are going to change kernel side, we should change
> to KEY_TOUCHPAD_TOGGLE in both eeepc-laptop and eeepc-wmi.
>
> http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=0d8b6be5f5238360d2d8e220d6da280f842c5358
>
> Chris
>

Thanks Chris for the information. I also tested; it works.

I will re-send a eeepc-wmi patch with KEY_TOUCHPAD_TOGGLE.

2011-03-01 04:56:43

by Keng-Yü Lin

[permalink] [raw]
Subject: [PATCH v2] eeepc-wmi: set the touchpad toggle key code to KEY_TOUCHPAD_TOGGLE

Signed-off-by: Keng-Yu Lin <[email protected]>
---
drivers/platform/x86/eeepc-wmi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index d399775..a9f75e2 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -113,7 +113,7 @@ static const struct key_entry eeepc_wmi_keymap[] = {
{ KE_KEY, 0x32, { KEY_MUTE } },
{ KE_KEY, 0x5c, { KEY_F15 } }, /* Power Gear key */
{ KE_KEY, 0x5d, { KEY_WLAN } },
- { KE_KEY, 0x6b, { KEY_F13 } }, /* Disable Touchpad */
+ { KE_KEY, 0x6b, { KEY_TOUCHPAD_TOGGLE } }, /* Toggle Touchpad */
{ KE_KEY, 0x82, { KEY_CAMERA } },
{ KE_KEY, 0x83, { KEY_CAMERA_ZOOMIN } },
{ KE_KEY, 0x88, { KEY_WLAN } },
--
1.7.1