lkml.org 
[lkml]   [2022]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 3/7] platform/x86: ideapad-laptop: Report KEY_CAMERA_ACCESS_TOGGLE instead of KEY_CAMERA
From
Hi Eray,

On 10/29/22 14:03, Eray Orçunus wrote:
> Reporting KEY_CAMERA when pressing camera switch key is wrong, since
> KEY_CAMERA is supposed to be used for taking snapshot. Change it with
> KEY_CAMERA_ACCESS_TOGGLE, so user-space can act correctly.

I'm afraid that we cannot just go and change the emitted key-code,
users might already have setup key-bindings to the existing
KEY_CAMERA code. Also key-codes >= 240 (decimal!) don't work in
X11 based desktop-environments. And even under Wayland they still
have issues, see e.g.:

https://gitlab.gnome.org/GNOME/gtk/-/issues/4353

So I'm afraid that I cannot take this patch.

Note that since a sparse_keymap is used, you can always override
this on your own systems by using a /etc/udev/hwdb.d/61-keyboard.hwdb
file, see: /lib/udev/hwdb.d/60-keyboard.hwdb for the syntax to
map a (sparse) scancode to the KEY_FOO code of your choice.

Regards,

Hans






>
> This patch needs KEY_CAMERA_ACCESS_TOGGLE to be defined, thus depends on
> "HID: add mapping for camera access keys" patch.
>
> Signed-off-by: Eray Orçunus <erayorcunus@gmail.com>
> ---
> drivers/platform/x86/ideapad-laptop.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
> index b67bac457a7a..0ef40b88b240 100644
> --- a/drivers/platform/x86/ideapad-laptop.c
> +++ b/drivers/platform/x86/ideapad-laptop.c
> @@ -1038,7 +1038,7 @@ static void ideapad_sysfs_exit(struct ideapad_private *priv)
> */
> static const struct key_entry ideapad_keymap[] = {
> { KE_KEY, 6, { KEY_SWITCHVIDEOMODE } },
> - { KE_KEY, 7, { KEY_CAMERA } },
> + { KE_KEY, 7, { KEY_CAMERA_ACCESS_TOGGLE } },
> { KE_KEY, 8, { KEY_MICMUTE } },
> { KE_KEY, 11, { KEY_F16 } },
> { KE_KEY, 13, { KEY_WLAN } },

\
 
 \ /
  Last update: 2022-11-15 21:36    [W:0.214 / U:0.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site