Skip to content

Commit 924c005

Browse files
Hans de Goedebsach64
authored andcommitted
Input: Add keycodes for electronic privacy screen on/off hotkeys
Add keycodes for hotkeys toggling the electronic privacy screen found on some laptops on/off. There already is an API for eprivacy screens as kernel-mode-setting drm connector object properties: https://www.kernel.org/doc/html/latest/gpu/drm-kms.html#standard-connector-properties this API also supports reporting when the eprivacy screen is turned on/off by the embedded-controller (EC) in response to hotkey presses. But on some laptops (e.g. the Dell Latitude 7300) the firmware does not allow querying the presence nor the status of the eprivacy screen at boot. This makes it impossible to implement the drm connector properties API since drm objects do not allow adding new properties after creation and the presence of the eprivacy cannot be detected at boot. The first notice of the presence of an eprivacy screen on these laptops is an EC generated (WMI) event when the eprivacy screen hotkeys are pressed. In this case the new keycodes this change adds can be generated to notify userspace of the eprivacy screen on/off hotkeys being pressed, so that userspace can show the usual on-screen-display (OSD) notification for eprivacy screen on/off to the user. This is similar to how e.g. touchpad on/off keycodes are used to show the touchpad on/off OSD. Signed-off-by: Hans de Goede <[email protected]> Acked-by: Dmitry Torokhov <[email protected]> Link: https://patch.msgid.link/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 1b6ea7d commit 924c005

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

include/uapi/linux/input-event-codes.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,18 @@
631631
#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */
632632
#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */
633633

634+
/*
635+
* Keycodes for hotkeys toggling the electronic privacy screen found on some
636+
* laptops on/off. Note when the embedded-controller turns on/off the eprivacy
637+
* screen itself then the state should be reported through drm connecter props:
638+
* https://www.kernel.org/doc/html/latest/gpu/drm-kms.html#standard-connector-properties
639+
* Except when implementing the drm connecter properties API is not possible
640+
* because e.g. the firmware does not allow querying the presence and/or status
641+
* of the eprivacy screen at boot.
642+
*/
643+
#define KEY_EPRIVACY_SCREEN_ON 0x252
644+
#define KEY_EPRIVACY_SCREEN_OFF 0x253
645+
634646
#define KEY_KBDINPUTASSIST_PREV 0x260
635647
#define KEY_KBDINPUTASSIST_NEXT 0x261
636648
#define KEY_KBDINPUTASSIST_PREVGROUP 0x262

0 commit comments

Comments
 (0)