2006-08-08 00:09:31

by Lennart Poettering

[permalink] [raw]
Subject: [PATCH] input: A few new KEY_xxx definitions

From: Lennart Poettering <[email protected]>

The attached patch adds four new KEY_xxx definitions to linux/input.h.

KEY_BLUETOOTH, KEY_WLAN:

Some laptops have seperate "rfkill"
buttons for disabling/enabling Bluetooth and WLAN.

KEY_POWERPLUG, KEY_POWERUNPLUG:

Some laptops generate a fake key event when the power cord is
plugged or unplugged. (Notably MSI laptops, such as S270)

Applies to all recent 2.6 kernels.

Please merge,
Lennart

Signed-off-by: Lennart Poettering <[email protected]>
---

--- include/linux/input.h.orig 2006-08-08 01:25:52.000000000 +0200
+++ include/linux/input.h 2006-08-08 01:43:13.000000000 +0200
@@ -347,8 +347,14 @@ struct input_absinfo {

#define KEY_BATTERY 236

+#define KEY_BLUETOOTH 237
+#define KEY_WLAN 238
+
#define KEY_UNKNOWN 240

+#define KEY_POWERPLUG 239
+#define KEY_POWERUNPLUG 241
+
#define BTN_MISC 0x100
#define BTN_0 0x100
#define BTN_1 0x101


2006-08-08 02:19:05

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH] input: A few new KEY_xxx definitions

On Monday 07 August 2006 20:09, Lennart Poettering wrote:
> From: Lennart Poettering <[email protected]>
>
> The attached patch adds four new KEY_xxx definitions to linux/input.h.
>
> KEY_BLUETOOTH, KEY_WLAN:
>
> Some laptops have seperate "rfkill"
> buttons for disabling/enabling Bluetooth and WLAN.
>
> KEY_POWERPLUG, KEY_POWERUNPLUG:
>
> Some laptops generate a fake key event when the power cord is
> plugged or unplugged. (Notably MSI laptops, such as S270)
>

How do these events get delivered? Are you saying that atkbd reports
key presses when pulling out AC cord?

--
Dmitry

2006-08-08 10:07:54

by Lennart Poettering

[permalink] [raw]
Subject: Re: [PATCH] input: A few new KEY_xxx definitions

On Mon, 07.08.06 22:19, Dmitry Torokhov ([email protected]) wrote:

> > KEY_POWERPLUG, KEY_POWERUNPLUG:
> >
> > Some laptops generate a fake key event when the power cord is
> > plugged or unplugged. (Notably MSI laptops, such as S270)
> >
>
> How do these events get delivered? Are you saying that atkbd reports
> key presses when pulling out AC cord?

Yes, exactly.

Lennart

2006-09-20 13:22:42

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH] input: A few new KEY_xxx definitions

On 8/8/06, Lennart Poettering <[email protected]> wrote:
> On Mon, 07.08.06 22:19, Dmitry Torokhov ([email protected]) wrote:
>
> > > KEY_POWERPLUG, KEY_POWERUNPLUG:
> > >
> > > Some laptops generate a fake key event when the power cord is
> > > plugged or unplugged. (Notably MSI laptops, such as S270)
> > >
> >
> > How do these events get delivered? Are you saying that atkbd reports
> > key presses when pulling out AC cord?
>
> Yes, exactly.
>

Lennart,

I applied part of the patch defining KEY_BLUETOOTH and KEY_WLAN, but I
did not apply KEY_POWER[UN]PLUG. I feel that these should not be
defined as KEY_* events but (if we decide that they should be reported
through input layer) as EV_PWR events.

--
Dmitry