2020-03-03 00:57:13

by Rajat Jain

[permalink] [raw]
Subject: [PATCH 1/2] Input: Add keycodes for keyboard backlight control

New keyboards can have backlight control keys. Allocating keycodes
for them. Such keyboards are already available in ChromeOS.

Signed-off-by: Rajat Jain <[email protected]>
---
include/uapi/linux/input-event-codes.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
index 0f1db1cccc3fd..e12a19dc30262 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -652,6 +652,10 @@
/* Electronic privacy screen control */
#define KEY_PRIVACY_SCREEN_TOGGLE 0x279

+/* Keyboard Backlight control */
+#define KEY_KBD_BKLIGHT_UP 0x280
+#define KEY_KBD_BKLIGHT_DOWN 0x281
+
/*
* Some keyboards have keys which do not have a defined meaning, these keys
* are intended to be programmed / bound to macros by the user. For most
--
2.25.0.265.gbab2e86ba0-goog


2020-03-03 00:59:02

by Rajat Jain

[permalink] [raw]
Subject: [PATCH 2/2] Input: Allocate keycode for SNIP key

New chromeos keyboards have a "snip" key that is basically a selective
screenshot (allows a user to select an area of screen to be copied).
Allocate a keyvode for it.

Signed-off-by: Rajat Jain <[email protected]>
---
include/uapi/linux/input-event-codes.h | 3 +++
1 file changed, 3 insertions(+)

diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
index e12a19dc30262..51f419657d044 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -656,6 +656,9 @@
#define KEY_KBD_BKLIGHT_UP 0x280
#define KEY_KBD_BKLIGHT_DOWN 0x281

+/* Selective Screenshot */
+#define KEY_SNIP 0x282
+
/*
* Some keyboards have keys which do not have a defined meaning, these keys
* are intended to be programmed / bound to macros by the user. For most
--
2.25.0.265.gbab2e86ba0-goog

2020-03-03 08:16:19

by Bastien Nocera

[permalink] [raw]
Subject: Re: [PATCH 1/2] Input: Add keycodes for keyboard backlight control

On Mon, 2020-03-02 at 16:56 -0800, Rajat Jain wrote:
> New keyboards can have backlight control keys. Allocating keycodes
> for them. Such keyboards are already available in ChromeOS.
>
> Signed-off-by: Rajat Jain <[email protected]>
> ---
> include/uapi/linux/input-event-codes.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/include/uapi/linux/input-event-codes.h
> b/include/uapi/linux/input-event-codes.h
> index 0f1db1cccc3fd..e12a19dc30262 100644
> --- a/include/uapi/linux/input-event-codes.h
> +++ b/include/uapi/linux/input-event-codes.h
> @@ -652,6 +652,10 @@
> /* Electronic privacy screen control */
> #define KEY_PRIVACY_SCREEN_TOGGLE 0x279
>
> +/* Keyboard Backlight control */
> +#define KEY_KBD_BKLIGHT_UP 0x280
> +#define KEY_KBD_BKLIGHT_DOWN 0x281

There's already KEY_KBDILLUMDOWN and KEY_KBDILLUMUP, used since the
aluminium PowerBook G4 in 2005 (commit
146a4b3bdfb5641bfbf975e29680b482b8b343ba)

> +
> /*
> * Some keyboards have keys which do not have a defined meaning,
> these keys
> * are intended to be programmed / bound to macros by the user. For
> most

2020-03-04 00:00:08

by Rajat Jain

[permalink] [raw]
Subject: Re: [PATCH 1/2] Input: Add keycodes for keyboard backlight control

On Tue, Mar 3, 2020 at 12:15 AM Bastien Nocera <[email protected]> wrote:
>
> On Mon, 2020-03-02 at 16:56 -0800, Rajat Jain wrote:
> > New keyboards can have backlight control keys. Allocating keycodes
> > for them. Such keyboards are already available in ChromeOS.
> >
> > Signed-off-by: Rajat Jain <[email protected]>
> > ---
> > include/uapi/linux/input-event-codes.h | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/include/uapi/linux/input-event-codes.h
> > b/include/uapi/linux/input-event-codes.h
> > index 0f1db1cccc3fd..e12a19dc30262 100644
> > --- a/include/uapi/linux/input-event-codes.h
> > +++ b/include/uapi/linux/input-event-codes.h
> > @@ -652,6 +652,10 @@
> > /* Electronic privacy screen control */
> > #define KEY_PRIVACY_SCREEN_TOGGLE 0x279
> >
> > +/* Keyboard Backlight control */
> > +#define KEY_KBD_BKLIGHT_UP 0x280
> > +#define KEY_KBD_BKLIGHT_DOWN 0x281
>
> There's already KEY_KBDILLUMDOWN and KEY_KBDILLUMUP, used since the
> aluminium PowerBook G4 in 2005 (commit
> 146a4b3bdfb5641bfbf975e29680b482b8b343ba)

Thank you for pointing out. Yes, I think those key codes will work for
me. I will use those instead.

Please consider this patch withdrawn.

Thanks & Best Regards,

Rajat Jain

>
> > +
> > /*
> > * Some keyboards have keys which do not have a defined meaning,
> > these keys
> > * are intended to be programmed / bound to macros by the user. For
> > most
>