Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3010835pxb; Fri, 5 Nov 2021 08:18:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwLQS4ShMvMz6G6E2fnX/+KcrHJ0xhJrCj/UdPg6AX8eEnMwyZooWyNFle5SO7Kb0IvMKe X-Received: by 2002:a05:6638:258e:: with SMTP id s14mr9578131jat.111.1636125532682; Fri, 05 Nov 2021 08:18:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636125532; cv=none; d=google.com; s=arc-20160816; b=V+ZALjs5g5+wQJTUPAuV6UW8r3YZFUpumF3tJHPUVtEC2++TNefe6DHgdaWMgUsq6x 2s4VFquQ2FDtbgXTnQdolMmajxKSWtpYG/PCIjX8bsNhsEzBX5ONbuI+Ma6SzpXeSVfl +ThVjTAsAgoZXeRJIZTXQcmu3QOQ93VDoaD1/eDq1rtiX7ctGGNRRDghQ4tcRBvz71uZ pzmLdw0REFoLfesbGnTuc6yUGrmwPyYVLwrjTgKzmIt+/mtaIftk/V8vvM6qgG7AhdBS aW2l1zC28qK98Xpm5RogKFfAzJuDMhJWcqXDpNroL9v1LYiVDFaZAVs6W7B0mFGIQ/Af DxFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=W7Ej9nUPelbvcg8WsAGskNxrFmjjze1zHOKgYJgl9Yg=; b=wt15FoezX6tdSIl76vcdEGRL28UqNykGPkB8JnKgrsnO+XojZah0O+PYZqzUnPTi61 ENaKdFiHgZUjM42HGS9PDYc1ZXbfSCidH6LzN1jdoKjF7TcngPPAM88/K12fEb1jEyJQ CWmZPl6dIPZftX5DZhWGbL2bWJxkEe38QFEiw5zj/qdGq+tEnD5DEf859po1t1KgeOJ5 G9ZZHGy5mluVVXjCghMTjJbh8eHSkQm5WeOcrGfhYkngHkp31jg4L1Kl9Pgei+fPUGrb utdw6wTnZ/GTUB+aJMjALuV11a40o6Ooj6bxnmzdfbuWDdK70p9FfI60m6hbKJvJEM0G n6Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HruQYqom; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 126si12057681jaj.60.2021.11.05.08.18.38; Fri, 05 Nov 2021 08:18:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HruQYqom; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233407AbhKEPTi (ORCPT + 99 others); Fri, 5 Nov 2021 11:19:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233356AbhKEPTh (ORCPT ); Fri, 5 Nov 2021 11:19:37 -0400 Received: from mail-ua1-x92f.google.com (mail-ua1-x92f.google.com [IPv6:2607:f8b0:4864:20::92f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69454C061714; Fri, 5 Nov 2021 08:16:57 -0700 (PDT) Received: by mail-ua1-x92f.google.com with SMTP id o26so17702127uab.5; Fri, 05 Nov 2021 08:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=W7Ej9nUPelbvcg8WsAGskNxrFmjjze1zHOKgYJgl9Yg=; b=HruQYqomszar0rWSAQkS/UJbSjf223BYbu2VidWlBtREhSvPDKJX369KX7L2W/eYWR TD9/tKwkZpoqSs3K2HcEIimuiFazZ8wFtrU4ie5j3LfXE2bJq0EbuaZctCUTx3aHmktN xJeBSDwTOU18Adx5zR4vIaqtlraXy+1W1Yalmfu2CgQn8myC7itrd0YwczJNIHoV99Bu xbiQNHNfFcsQQ+/wRmcejzPF1M+T+KhNMMQdLKWjf9lY7Uh2+vRMUXotDFLEBRSlJ3LN Gv59XMjL9GSwT03KbNqo0GIOf1E2wa+P4OHP1m15caL3JyCKto+3lwKuZ/HdUrzMMVRq dX8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=W7Ej9nUPelbvcg8WsAGskNxrFmjjze1zHOKgYJgl9Yg=; b=B7kwBX0dvRjo+sNK7v86gHTuoAEc/op5IK0bhbZHXcjDcWCDIlQBDVMUqId3LowN8M XuxMIKBDDPSXCdeRettW1z8MRU87HHL3mFhzINRPjB1yM88L/qJWopWwnF7dxKOpV4P5 Ne8iuEUt8z4ViceyrV5XGrKwNWCuU15V67zitFezhcC8P9wHHa6t0TQh8eJ34TbboScS dVuorr1qV2YtzNJW1NBF8Ucqh4Kj88d/LOHNfq5RSHVnJk+HyfSD4YmUQze+6J00eo3h teCZG+F3M6J7ntBoSJyOD4SHQo1bY5WbsqT1AwBnMYWtIA87o9ZpMYx/KnUvCmANWCx3 fm3g== X-Gm-Message-State: AOAM5316I3Sk+bSmBb5i3xmfjKuWFDbVgG+cIi9UhEaF7a5PZGzI7OqC g1n2tkHTbUYEVLErlnwaKHKRVrsGgl8pzvewIHhyI8ON8DM= X-Received: by 2002:a67:ed8c:: with SMTP id d12mr72198197vsp.45.1636125416361; Fri, 05 Nov 2021 08:16:56 -0700 (PDT) MIME-Version: 1.0 References: <20211008222327.9324-1-angiolucci@gmail.com> In-Reply-To: From: =?UTF-8?Q?Vin=C3=ADcius_Reis?= Date: Fri, 5 Nov 2021 12:16:45 -0300 Message-ID: Subject: Re: [PATCH] HID: hid-asus.c: Maps key 0x35 (display off) to KEY_SCREENLOCK To: Dmitry Torokhov Cc: Jiri Kosina , "linux-input@vger.kernel.org" , lkml , angiolucci@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em qui., 28 de out. de 2021 =C3=A0s 13:07, Dmitry Torokhov escreveu: > > Hi Vin=C3=ADcius, > > On Fri, Oct 8, 2021 at 3:24 PM Vin=C3=ADcius Angiolucci Reis > wrote: > > > > 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. > > But is it the intent of the user? The fact that current desktop > environments do not handle this key is not a reason to change kernel > behavior. > > If screen lock is simply your preference then you can change the > mapping via udev on your system without the need to patch the kernel. > > Thanks. > > -- > Dmitry (Sorry, I'm sending this response again because it seems the first attempt didn't make it to the mailing lists for some reason.) Hi Dmitry, I've picked up this particular key event because it would trigger a close behavior to the one seen on Windows. It is far from being my preference, which would be an exact mimic of the Windows behavior (and can be achieved by xset dpms force on/off from user space). The idea of this patch is to improve the user experience, by giving that ke= y a behavior as close as possible to what users might experience on Windows. Because most Linux desktop environments also turn the display off after locking the screen, this would be a good approximation to what happens on Windows. I think it is more about giving (consistent) behavior to it than changing it. I agree it is possible to control that via udev or something else. But most regular users won't be able to do that, ending up with an unused key, though. The hardcore user that would prefer a very different key behavior could keep using udev to do that. So IMHO I think that setting this up on the kernel would be a good approach in this case. Thanks. Vin=C3=ADcius