All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] HID: hid-asus.c: Maps key 0x35 (display off) to KEY_SCREENLOCK
@ 2021-10-08 22:23 Vinícius Angiolucci Reis
  2021-10-19  9:17 ` Jiri Kosina
  2021-10-28 16:07 ` Dmitry Torokhov
  0 siblings, 2 replies; 9+ messages in thread
From: Vinícius Angiolucci Reis @ 2021-10-08 22:23 UTC (permalink / raw)
  To: jikos; +Cc: linux-input, linux-kernel, angiolucci

On Windows systems, ASUS laptops uses the "turn display off" key
(usually fn+f6) to turn both display and keyboard backlit off. On Linux
systems, this key has no effect at all since most desktop enviroments
don't deal with KEY_DISPLAY_OFF. By mapping it to KEY_SCREENLOCK
instead, would enable desktop environments to handle this key as a
screen lock intent from the user, out of the box.

Signed-off-by: Vinícius Angiolucci Reis <angiolucci@gmail.com>
---
 drivers/hid/hid-asus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index f3ecddc519ee..5d57214d8dee 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -854,7 +854,7 @@ static int asus_input_mapping(struct hid_device *hdev,
 		switch (usage->hid & HID_USAGE) {
 		case 0x10: asus_map_key_clear(KEY_BRIGHTNESSDOWN);	break;
 		case 0x20: asus_map_key_clear(KEY_BRIGHTNESSUP);		break;
-		case 0x35: asus_map_key_clear(KEY_DISPLAY_OFF);		break;
+		case 0x35: asus_map_key_clear(KEY_SCREENLOCK);		break;
 		case 0x6c: asus_map_key_clear(KEY_SLEEP);		break;
 		case 0x7c: asus_map_key_clear(KEY_MICMUTE);		break;
 		case 0x82: asus_map_key_clear(KEY_CAMERA);		break;
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-11-09 10:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-08 22:23 [PATCH] HID: hid-asus.c: Maps key 0x35 (display off) to KEY_SCREENLOCK Vinícius Angiolucci Reis
2021-10-19  9:17 ` Jiri Kosina
2021-10-28 16:07 ` Dmitry Torokhov
2021-11-05 15:16   ` Vinícius Reis
2021-11-05 21:55     ` Dmitry Torokhov
2021-11-06 23:48       ` Vinícius Reis
2021-11-07  2:08         ` Dmitry Torokhov
2021-11-07  2:35           ` Vinícius Reis
2021-11-09 10:21             ` Jiri Kosina

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.