diff mbox series

HID: Add mapping for KEY_APP_LAUNCHER

Message ID 20220217053354.1.I3a7746ad05d270161a18334ae06e3b6db1a1d339@changeid (mailing list archive)
State New, archived
Headers show
Series HID: Add mapping for KEY_APP_LAUNCHER | expand

Commit Message

William Mahon Feb. 17, 2022, 5:33 a.m. UTC
The App Launcher key is used to bring up the Launcher menu.

This patch adds a new key definition KEY_APP_LAUNCHER and maps 0x0c02a28
usage code to this new keycode. Additionally hid-debug is adjusted to
recognize this new usage code as well.

Signed-off-by: William Mahon <wmahon@google.com>
---

 drivers/hid/hid-debug.c                | 1 +
 drivers/hid/hid-input.c                | 2 ++
 include/uapi/linux/input-event-codes.h | 2 ++
 3 files changed, 5 insertions(+)

Comments

Bastien Nocera Feb. 17, 2022, 10:35 a.m. UTC | #1
On Thu, 2022-02-17 at 05:33 +0000, William Mahon wrote:
> The App Launcher key is used to bring up the Launcher menu.
> 
> This patch adds a new key definition KEY_APP_LAUNCHER and maps
> 0x0c02a28
 
Is this a typo? It's not the same format as in your other patch.

KEY_DASHBOARD as used in the Mac keyboard drivers looks like a good
match for KEY_APP_LAUNCHER. If not, it would be good to explain why in
the commit message.

See 437184ae8bd1ef923a40b009e37801deae66ad55 for the KEY_DASHBOARD
addition.

> usage code to this new keycode. Additionally hid-debug is adjusted to
> recognize this new usage code as well.
> 
> Signed-off-by: William Mahon <wmahon@google.com>
> ---
> 
>  drivers/hid/hid-debug.c                | 1 +
>  drivers/hid/hid-input.c                | 2 ++
>  include/uapi/linux/input-event-codes.h | 2 ++
>  3 files changed, 5 insertions(+)
> 
> diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
> index 01135713e8f9..36a42ad3b7bc 100644
> --- a/drivers/hid/hid-debug.c
> +++ b/drivers/hid/hid-debug.c
> @@ -930,6 +930,7 @@ static const char *keys[KEY_MAX + 1] = {
>         [KEY_SCREENSAVER] = "ScreenSaver",
>         [KEY_VOICECOMMAND] = "VoiceCommand",
>         [KEY_EMOJI_PICKER] = "EmojiPicker",
> +       [KEY_APP_LAUNCHER] = "AppLauncher",
>         [KEY_BRIGHTNESS_MIN] = "BrightnessMin",
>         [KEY_BRIGHTNESS_MAX] = "BrightnessMax",
>         [KEY_BRIGHTNESS_AUTO] = "BrightnessAuto",
> diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> index eccd89b5ea9f..7c89260826b2 100644
> --- a/drivers/hid/hid-input.c
> +++ b/drivers/hid/hid-input.c
> @@ -1162,6 +1162,8 @@ static void hidinput_configure_usage(struct
> hid_input *hidinput, struct hid_fiel
>  
>                 case 0x29d:
> map_key_clear(KEY_KBD_LAYOUT_NEXT); break;
>  
> +               case 0x2a2:
> map_key_clear(KEY_APP_LAUNCHER);    break;
> +
>                 case 0x2c7:
> map_key_clear(KEY_KBDINPUTASSIST_PREV);             break;
>                 case 0x2c8:
> map_key_clear(KEY_KBDINPUTASSIST_NEXT);             break;
>                 case 0x2c9:
> map_key_clear(KEY_KBDINPUTASSIST_PREVGROUP);                break;
> diff --git a/include/uapi/linux/input-event-codes.h
> b/include/uapi/linux/input-event-codes.h
> index 311a57f3e01a..fdf43cf14125 100644
> --- a/include/uapi/linux/input-event-codes.h
> +++ b/include/uapi/linux/input-event-codes.h
> @@ -651,6 +651,8 @@
>  #define KEY_DATA                       0x277
>  #define KEY_ONSCREEN_KEYBOARD          0x278
>  
> +#define KEY_APP_LAUNCHER               0x27c
> +
>  #define BTN_TRIGGER_HAPPY              0x2c0
>  #define BTN_TRIGGER_HAPPY1             0x2c0
>  #define BTN_TRIGGER_HAPPY2             0x2c1
Dmitry Torokhov Feb. 18, 2022, 6:48 a.m. UTC | #2
On Thu, Feb 17, 2022 at 11:35:24AM +0100, Bastien Nocera wrote:
> On Thu, 2022-02-17 at 05:33 +0000, William Mahon wrote:
> > The App Launcher key is used to bring up the Launcher menu.
> > 
> > This patch adds a new key definition KEY_APP_LAUNCHER and maps
> > 0x0c02a28
>  
> Is this a typo? It's not the same format as in your other patch.
> 
> KEY_DASHBOARD as used in the Mac keyboard drivers looks like a good
> match for KEY_APP_LAUNCHER. If not, it would be good to explain why in
> the commit message.
> 
> See 437184ae8bd1ef923a40b009e37801deae66ad55 for the KEY_DASHBOARD
> addition.

I agree that the spirit of KEY_DASHBOARD is what I think we want here,
but IMO neither KEY_DASHBOARD nor KEY_APP_LAUNCHER are good names for
this. Maybe we could use KEY_ALL_APPLICATIONS (and alias
KEY_KEY_DASHBOARD to it for compatibility)?

Thanks.
diff mbox series

Patch

diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
index 01135713e8f9..36a42ad3b7bc 100644
--- a/drivers/hid/hid-debug.c
+++ b/drivers/hid/hid-debug.c
@@ -930,6 +930,7 @@  static const char *keys[KEY_MAX + 1] = {
 	[KEY_SCREENSAVER] = "ScreenSaver",
 	[KEY_VOICECOMMAND] = "VoiceCommand",
 	[KEY_EMOJI_PICKER] = "EmojiPicker",
+	[KEY_APP_LAUNCHER] = "AppLauncher",
 	[KEY_BRIGHTNESS_MIN] = "BrightnessMin",
 	[KEY_BRIGHTNESS_MAX] = "BrightnessMax",
 	[KEY_BRIGHTNESS_AUTO] = "BrightnessAuto",
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index eccd89b5ea9f..7c89260826b2 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1162,6 +1162,8 @@  static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 
 		case 0x29d: map_key_clear(KEY_KBD_LAYOUT_NEXT);	break;
 
+		case 0x2a2: map_key_clear(KEY_APP_LAUNCHER);	break;
+
 		case 0x2c7: map_key_clear(KEY_KBDINPUTASSIST_PREV);		break;
 		case 0x2c8: map_key_clear(KEY_KBDINPUTASSIST_NEXT);		break;
 		case 0x2c9: map_key_clear(KEY_KBDINPUTASSIST_PREVGROUP);		break;
diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
index 311a57f3e01a..fdf43cf14125 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -651,6 +651,8 @@ 
 #define KEY_DATA			0x277
 #define KEY_ONSCREEN_KEYBOARD		0x278
 
+#define KEY_APP_LAUNCHER		0x27c
+
 #define BTN_TRIGGER_HAPPY		0x2c0
 #define BTN_TRIGGER_HAPPY1		0x2c0
 #define BTN_TRIGGER_HAPPY2		0x2c1