Re: input question: ambient light sensor button

From
Benjamin Tissoires <hidden>
Date
2013-11-20 15:59:49
Also in
lkml
Reply to
Pali Rohár, 2013-11-20
Hi,

On Wed, Nov 20, 2013 at 9:50 AM, Pali Rohár [off-list ref] wrote:
quoted hunk ↗ jump to hunk
quoted
quoted
quoted
I guess we need patch adding

  #define KEY_ALS_TOGGLE  0x230

Thanks.
So there is no good key for als yet?
No, but if you send me a patch adding it I will gladly apply
it.

Thanks.
Ok, here is patch:

Add key code for ambient light sensor button

More notebooks have special button for enabling/disabling ambient
light sensor. This patch adding new als code to input.h header file.

Signed-off-by: Pali Rohár <redacted>
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
index a372627..1562f10 100644
--- a/include/uapi/linux/input.h
+++ b/include/uapi/linux/input.h
@@ -719,6 +719,8 @@ struct input_keymap_entry {
 #define BTN_DPAD_LEFT          0x222
 #define BTN_DPAD_RIGHT         0x223

+#define KEY_ALS_TOGGLE         0x230
Could you just add a comment explaining that ALS is ambiant light
sensor? Otherwise, I'm sure someone else will use this event code for
an other thing... :)

Cheers,
Benjamin
Thread (9 messages) 9 messages, 4 authors, last reply 2013-11-26
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help