linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: Add wireless and bluetooth keycodes
@ 2007-05-03 11:15 Carlos Corbacho
  2007-05-03 11:58 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Carlos Corbacho @ 2007-05-03 11:15 UTC (permalink / raw)
  To: linux-input

Add wireless and bluetooth keycodes. Also, add keycodes for these
keys having a separate off state (This is true on some machines,
such as many Acer laptops).

Signed-off-by: Carlos Corbacho <cathectic@gmail.com>
---
There don't appear to be any keycodes defined for wireless and bluetooth.
On my laptop (Acer Aspire 5021) these buttons generate scancodes, rather 
than being hardware controlled or generating an ACPI hotkey event, so it 
would be nice to have some standard keycodes to map them to.

Plus, to cause more bother, the buttons on my laptop also generate a 
different scancode depending on whether the device in question is enabled
or disabled (hence the _OFF entries). This is also true for an awful lot of
other Acer laptops.

--- linux-2.6.21/include/linux/input.h.orig	2007-05-03 11:48:15.000000000 +0100
+++ linux-2.6.21/include/linux/input.h	2007-05-03 11:48:21.000000000 +0100
@@ -506,6 +506,10 @@
 #define KEY_VOICEMAIL		0x1ac
 #define KEY_ADDRESSBOOK		0x1ad
 #define KEY_MESSENGER		0x1ae
+#define KEY_WIRELESS		0x1b0
+#define KEY_WIRELESS_OFF	0x1b1
+#define KEY_BLUETOOTH		0x1b2
+#define KEY_BLUETOOTH_OFF	0x1b3
 
 #define KEY_DEL_EOL		0x1c0
 #define KEY_DEL_EOS		0x1c1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] input: Add wireless and bluetooth keycodes
  2007-05-03 11:15 [PATCH] input: Add wireless and bluetooth keycodes Carlos Corbacho
@ 2007-05-03 11:58 ` Dmitry Torokhov
  2007-05-03 12:18   ` Carlos Corbacho
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2007-05-03 11:58 UTC (permalink / raw)
  To: Carlos Corbacho; +Cc: linux-input

Hi Carlos,

On 5/3/07, Carlos Corbacho <cathectic@gmail.com> wrote:
> Add wireless and bluetooth keycodes.

Already have them:

#define KEY_BLUETOOTH           237
#define KEY_WLAN                238

> Also, add keycodes for these
> keys having a separate off state (This is true on some machines,
> such as many Acer laptops).
>

Not sure why this is needed.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] input: Add wireless and bluetooth keycodes
  2007-05-03 11:58 ` Dmitry Torokhov
@ 2007-05-03 12:18   ` Carlos Corbacho
  0 siblings, 0 replies; 3+ messages in thread
From: Carlos Corbacho @ 2007-05-03 12:18 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

Dimitry,

On Thursday 03 May 2007 12:58:45 Dmitry Torokhov wrote:
> Already have them:
>
> #define KEY_BLUETOOTH           237
> #define KEY_WLAN                238

My bad.

> > Also, add keycodes for these
> > keys having a separate off state (This is true on some machines,
> > such as many Acer laptops).
>
> Not sure why this is needed.

On my laptop (this also affects other Acer's), the real problem is that there 
is no way to tell if the device is enabled or disabled[1], unless you're 
keeping track of this yourself (not always reliable). The only thing that 
always changes is the scancode for the button in question.

It would be nice to have a separate keycode to match to the different 
scancodes for on and off (then match these to the relevant calls), rather 
than say for instance, mapping both wireless scancodes to KEY_WLAN, then 
trying to keep track of the current state and then deciding on this whether 
to disable the device in question (and then potentially deciding wrong).

-Carlos

[1] The wireless/ bluetooth features on some Acer laptops are software 
enabled, by ACPI methods calling a Windows Management Instrumentation 
device - and to add insult to injury, the WMI interface provided doesn't give 
us any means to find out the current state of these features.
-- 
Uni: c.corbacho@cs.ucl.ac.uk
Home: cathectic@gmail.com
GPG Key ID: 0x23EE722D

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-03 12:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-03 11:15 [PATCH] input: Add wireless and bluetooth keycodes Carlos Corbacho
2007-05-03 11:58 ` Dmitry Torokhov
2007-05-03 12:18   ` Carlos Corbacho

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).