input: Add event code for accessibility key
Subsystems (2)
PATCH 1/2 input: Add event code for accessibility key
HUTRR116 added support for a new usage titled "System Accessibility Binding" which toggles a system-wide bound accessibility UI or command. This commit simply adds a new event code for the usage.
--- drivers/hid/hid-debug.c | 1 + drivers/hid/hid-input.c | 3 +++ include/uapi/linux/input-event-codes.h | 2 ++ 3 files changed, 6 insertions(+)
drivers/hid/hid-debug.c +1 -0
@@ -974,6 +974,7 @@ static const char *keys[KEY_MAX + 1] = { [KEY_CAMERA_ACCESS_ENABLE] = "CameraAccessEnable", [KEY_CAMERA_ACCESS_DISABLE] = "CameraAccessDisable", [KEY_CAMERA_ACCESS_TOGGLE] = "CameraAccessToggle", + [KEY_ACCESSIBILITY] = "Accessibility", [KEY_DICTATE] = "Dictate", [KEY_MICMUTE] = "MicrophoneMute", [KEY_BRIGHTNESS_MIN] = "BrightnessMin",
drivers/hid/hid-input.c +3 -0
@@ -829,6 +829,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielif ((usage->hid &0xf0 ) ==0xa0 ) {/* SystemControl */ switch (usage->hid &0xf ) {case 0x9 :map_key_clear (KEY_MICMUTE );break ; +case 0xa : +map_key_clear (KEY_ACCESSIBILITY ); +break ;default : goto ignore; }break ;
include/uapi/linux/input-event-codes.h +2 -0
@@ -617,6 +617,8 @@#define KEY_CAMERA_ACCESS_ENABLE 0x24b/* Enables programmatic access to camera devices. (HUTRR72) */ #define KEY_CAMERA_ACCESS_DISABLE 0x24c/* Disables programmatic access to camera devices. (HUTRR72) */ #define KEY_CAMERA_ACCESS_TOGGLE 0x24d/* Toggles the current state of the camera access control. (HUTRR72) */ +/* Toggles the system bound accessibility UI/command (HUTRR116) */ +#define KEY_ACCESSIBILITY 0x24e#define KEY_BRIGHTNESS_MIN 0x250/* Set Brightness to Minimum */ #define KEY_BRIGHTNESS_MAX 0x251/* Set Brightness to Maximum */
base-commit: 5128de84d8fc849400d00f7a6982711f129699ea
Signature · 1 line
2.45.1.288.g0e0cd299f1-goog
PATCH 2/2 input: Add support for "Do Not Disturb"
HUTRR94 added support for a new usage titled "System Do Not Disturb" which toggles a system-wide Do Not Disturb setting. This commit simply adds a new event code for the usage.
--- drivers/hid/hid-debug.c | 1 + drivers/hid/hid-input.c | 11 +++++++++++ include/uapi/linux/input-event-codes.h | 2 ++ 3 files changed, 14 insertions(+)
drivers/hid/hid-debug.c +1 -0
@@ -975,6 +975,7 @@ static const char *keys[KEY_MAX + 1] = { [KEY_CAMERA_ACCESS_DISABLE] = "CameraAccessDisable", [KEY_CAMERA_ACCESS_TOGGLE] = "CameraAccessToggle", [KEY_ACCESSIBILITY] = "Accessibility", + [KEY_DONOTDISTURB] = "DoNotDisturb", [KEY_DICTATE] = "Dictate", [KEY_MICMUTE] = "MicrophoneMute", [KEY_BRIGHTNESS_MIN] = "BrightnessMin",
drivers/hid/hid-input.c +11 -0
@@ -826,6 +826,17 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielbreak ; } +if ((usage->hid &0xf0 ) ==0x90 ) {/* SystemControl*/ +switch (usage->hid &0xf ) { +case 0xb : +map_key_clear (KEY_DONOTDISTURB ); +break ; +default : + goto ignore; + } +break ; + } +if ((usage->hid &0xf0 ) ==0xa0 ) {/* SystemControl */ switch (usage->hid &0xf ) {case 0x9 :map_key_clear (KEY_MICMUTE );break ;
include/uapi/linux/input-event-codes.h +2 -0
@@ -619,6 +619,8 @@#define KEY_CAMERA_ACCESS_TOGGLE 0x24d/* Toggles the current state of the camera access control. (HUTRR72) */ /* Toggles the system bound accessibility UI/command (HUTRR116) */ #define KEY_ACCESSIBILITY 0x24e +/* Toggles the system-wide "Do Not Disturb" control (HUTRR94)*/ +#define KEY_DONOTDISTURB 0x24f#define KEY_BRIGHTNESS_MIN 0x250/* Set Brightness to Minimum */ #define KEY_BRIGHTNESS_MAX 0x251/* Set Brightness to Maximum */
Signature · 1 line
2.45.1.288.g0e0cd299f1-goog
Dmitry Torokhov
maintainerRe: [PATCH 2/2] input: Add support for "Do Not Disturb"
Quoted 50 lines · Aseda Aboagye
HUTRR94 added support for a new usage titled "System Do Not Disturb" which toggles a system-wide Do Not Disturb setting. This commit simply adds a new event code for the usage.
Signed-off-by Aseda Aboagye <[email protected]>--- drivers/hid/hid-debug.c | 1 + drivers/hid/hid-input.c | 11 +++++++++++ include/uapi/linux/input-event-codes.h | 2 ++ 3 files changed, 14 insertions(+)drivers/hid/hid-debug.c +1
-0@@ -975,6 +975,7 @@ static const char *keys[KEY_MAX + 1] = { [KEY_CAMERA_ACCESS_DISABLE] = "CameraAccessDisable", [KEY_CAMERA_ACCESS_TOGGLE] = "CameraAccessToggle", [KEY_ACCESSIBILITY] = "Accessibility", + [KEY_DONOTDISTURB] = "DoNotDisturb", [KEY_DICTATE] = "Dictate", [KEY_MICMUTE] = "MicrophoneMute", [KEY_BRIGHTNESS_MIN] = "BrightnessMin",drivers/hid/hid-input.c +11
-0@@ -826,6 +826,17 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielbreak ; } +if ((usage->hid &0xf0 ) ==0x90 ) {/* SystemControl*/ +switch (usage->hid &0xf ) { +case 0xb : +map_key_clear (KEY_DONOTDISTURB ); +break ; +default : + goto ignore; + } +break ; + } +if ((usage->hid &0xf0 ) ==0xa0 ) {/* SystemControl */ switch (usage->hid &0xf ) {case 0x9 :map_key_clear (KEY_MICMUTE );break ;include/uapi/linux/input-event-codes.h +0
-0
include/uapi/linux/input-event-codes.h line 623
Quoted 5 lines
include/uapi/linux/input-event-codes.h +2
-0@@ -619,6 +619,8 @@#define KEY_CAMERA_ACCESS_TOGGLE 0x24d/* Toggles the current state of the camera access control. (HUTRR72) */ /* Toggles the system bound accessibility UI/command (HUTRR116) */ #define KEY_ACCESSIBILITY 0x24e +/* Toggles the system-wide "Do Not Disturb" control (HUTRR94)*/ +#define KEY_DONOTDISTURB 0x24f
Could we have this as KEY_DO_NOT_DISTURB?
Also the same comments as on the previous patch.
Thanks.
Signature · 1 line
Dmitry
Dmitry Torokhov
maintainerQuoted 28 lines · Aseda Aboagye
HUTRR116 added support for a new usage titled "System Accessibility Binding" which toggles a system-wide bound accessibility UI or command. This commit simply adds a new event code for the usage.
Signed-off-by Aseda Aboagye <[email protected]>--- drivers/hid/hid-debug.c | 1 + drivers/hid/hid-input.c | 3 +++ include/uapi/linux/input-event-codes.h | 2 ++ 3 files changed, 6 insertions(+)drivers/hid/hid-debug.c +1
-0@@ -974,6 +974,7 @@ static const char *keys[KEY_MAX + 1] = { [KEY_CAMERA_ACCESS_ENABLE] = "CameraAccessEnable", [KEY_CAMERA_ACCESS_DISABLE] = "CameraAccessDisable", [KEY_CAMERA_ACCESS_TOGGLE] = "CameraAccessToggle", + [KEY_ACCESSIBILITY] = "Accessibility", [KEY_DICTATE] = "Dictate", [KEY_MICMUTE] = "MicrophoneMute", [KEY_BRIGHTNESS_MIN] = "BrightnessMin",drivers/hid/hid-input.c +0
-0
drivers/hid/hid-input.c static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel · line 834
Quoted 6 lines
drivers/hid/hid-input.c +3
-0@@ -829,6 +829,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielif ((usage->hid &0xf0 ) ==0xa0 ) {/* SystemControl */ switch (usage->hid &0xf ) {case 0x9 :map_key_clear (KEY_MICMUTE );break ; +case 0xa : +map_key_clear (KEY_ACCESSIBILITY ); +break ;
Please keep the style to match with the rest of the file.
include/uapi/linux/input-event-codes.h line 621
Quoted 13 lines
drivers/hid/hid-input.c +0
-0default : goto ignore; }break ;include/uapi/linux/input-event-codes.h +2
-0@@ -617,6 +617,8 @@#define KEY_CAMERA_ACCESS_ENABLE 0x24b/* Enables programmatic access to camera devices. (HUTRR72) */ #define KEY_CAMERA_ACCESS_DISABLE 0x24c/* Disables programmatic access to camera devices. (HUTRR72) */ #define KEY_CAMERA_ACCESS_TOGGLE 0x24d/* Toggles the current state of the camera access control. (HUTRR72) */ +/* Toggles the system bound accessibility UI/command (HUTRR116) */ +#define KEY_ACCESSIBILITY 0x24e
Please have the comment after the value to match with the rest of the file (even though it results in a long line).
Quoted 7 lines
include/uapi/linux/input-event-codes.h +0
-0#define KEY_BRIGHTNESS_MIN 0x250/* Set Brightness to Minimum */ #define KEY_BRIGHTNESS_MAX 0x251/* Set Brightness to Maximum */ base-commit:
5128de84d8fc849400d00f7a6982711f129699eaSignature · 1 line
2.45.1.288.g0e0cd299f1-goog
Thanks.
Signature · 1 line
Dmitry