Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp658055pxb; Thu, 17 Feb 2022 11:48:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzIflOI8HjXJiS2LZPq0MH42v+IjAVwMT5HZd2YvBJaXGy8Ssu9JlNtvJbK998XaUtu1eQj X-Received: by 2002:a17:90a:6383:b0:1b9:64d7:3af9 with SMTP id f3-20020a17090a638300b001b964d73af9mr8766423pjj.156.1645127320469; Thu, 17 Feb 2022 11:48:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645127320; cv=none; d=google.com; s=arc-20160816; b=LuYPfKXLd70Kec9Sy97wHWd+4CEs318bXxqcRKHKhfvkQiykgKdkqsH6EYk8awXvBN bkZIGnupFGapYpIjVXmhrtK2mebF3RIB21jSYxdgkOl/CTBindcaDC6EGPvRKurLMpRz Q11naTVjvcTDFFL3bj6osBV8fsUOf+c7tOH9G8a2F+l1isCVPFBbiBNCH8oVA1rXqpvB dz6xsNLn11Ou3v19ZFbNX0aQIWg3rs7KiUrt8ro3UcrO4hLE/M2ZYo4EdylhwidahYTr SRel3FhTAONHJQD0gqdY3W74v9qKKlNiEDMjqinIuvSGKxMMTvpRNydhWVtsk9gq0a5Q pFOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Sc+EaJrNQanDC0tIQ/+hLCZwmcOXKaQszAADxGMNESM=; b=dKm4FJeNc1fD9oPn3SGFbzj9kAGsNjfzJ8F3xIBo1xmUmQPtcw8zKwShuVyudinX/d cdPxMMzqNiOyjod2Q5U63kAWgxf0TaFOdyxr0SdoIzsHr0v3d3Dj4zf5Lq7S9hPU54CW Aqaf8SKj7SW7Nn9FnHcCQxts6aw1lIMC/BvZ0jmtLaoVwQHMFnsN0JSKURUZqRDmmZ2k YJKiBi7qDb4NsiEmJwvHQMtxBcVsYRS/S9wExf2Ouc+YM66X+tkH7ixzc5ddGe2JtAJx y97Vrd3aSzJVRnJAbB++FhUQ/2l5H2eeBy1HymWzfRi5jqCnrbD6X3UptZOzlCegYlrY A2mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=d+gLtI0i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f22si531321pfj.348.2022.02.17.11.48.24; Thu, 17 Feb 2022 11:48:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=d+gLtI0i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244980AbiBQTIL (ORCPT + 99 others); Thu, 17 Feb 2022 14:08:11 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:46864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244993AbiBQTIJ (ORCPT ); Thu, 17 Feb 2022 14:08:09 -0500 Received: from mail-vk1-xa36.google.com (mail-vk1-xa36.google.com [IPv6:2607:f8b0:4864:20::a36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E70FC85678 for ; Thu, 17 Feb 2022 11:07:54 -0800 (PST) Received: by mail-vk1-xa36.google.com with SMTP id j201so3596267vke.11 for ; Thu, 17 Feb 2022 11:07:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Sc+EaJrNQanDC0tIQ/+hLCZwmcOXKaQszAADxGMNESM=; b=d+gLtI0iBFxzsdc1bjOFp4XYw3wkM9H8ua5Ht5qwuLPzCq2mtdenqFtfIZDWdRhsWY VIWn/r+o3PYhBNfxsKv+GnKX9+RJooqUDpB+rW82OR4DCH3+Zz5d1iKBoLRde/gFw1B9 FJCfB19/KsaYaqfwLzTeHjBY1IcHyP78eTTVs= 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; bh=Sc+EaJrNQanDC0tIQ/+hLCZwmcOXKaQszAADxGMNESM=; b=beEeQL+ztnh27Z1HcOR4+BWY3W560SsyGdATGwCRwGi07guNHaMSjKH1B8xFGWmnu0 0D+P+icmWOkbimRxaqqMI9JTeNA1TTLdHj9HBW7DuZ+YsHC+EI9ueupONAD6sukWUGc0 6uWpVuQmdJ9JxmMUpNcr4y4QnNQQClDbroB72jLkHFW7sR16yABzsAplXqirIWWon8GX d54MubFiluaY1GDGPw8IoJqj77mhE90EkNDpw1rSP0/hwAeHipVNuRd7SR0jlJu7lkrW vKlZnlx7qpSHhGxi55a75nnf7Qwut9ePxWJASFtnYUVxK2wUdJYCwNZJQtsVZEIrqD3W SsAA== X-Gm-Message-State: AOAM532t2L3frIooQLZs+WqIXC1pMY/rxpFN9r5aaV1FipfvHhK5PCKK LmR+CNbfiSFoJZB/1aq4dUacbbAsOPKjag== X-Received: by 2002:a05:6122:549:b0:330:288:f36d with SMTP id y9-20020a056122054900b003300288f36dmr1905833vko.28.1645124873918; Thu, 17 Feb 2022 11:07:53 -0800 (PST) Received: from mail-vs1-f50.google.com (mail-vs1-f50.google.com. [209.85.217.50]) by smtp.gmail.com with ESMTPSA id v201sm7753922vkv.54.2022.02.17.11.07.51 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 11:07:51 -0800 (PST) Received: by mail-vs1-f50.google.com with SMTP id w4so7428487vsq.1 for ; Thu, 17 Feb 2022 11:07:51 -0800 (PST) X-Received: by 2002:a67:ac0a:0:b0:31b:6b29:f7b4 with SMTP id v10-20020a67ac0a000000b0031b6b29f7b4mr1993579vse.84.1645124870982; Thu, 17 Feb 2022 11:07:50 -0800 (PST) MIME-Version: 1.0 References: <20220217041427.1.I5dbf50eb1a7a6734ee727bda4a8573358c6d3ec0@changeid> In-Reply-To: <20220217041427.1.I5dbf50eb1a7a6734ee727bda4a8573358c6d3ec0@changeid> From: Harry Cutts Date: Thu, 17 Feb 2022 11:07:40 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] HID: Add mapping for KEY_DICTATE To: William Mahon Cc: LKML , William Mahon , Benjamin Tissoires , Dmitry Torokhov , Jiri Kosina , linux-input Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Will, On Wed, 16 Feb 2022 at 20:15, William Mahon wrote: > > Numerous keyboards are adding dicate keys which allows for text > messages to be dicated by a microphone. Nit: a couple of typos for "dictate". > > This patch adds a new key definition KEY_DICTATE and maps 0x0c/0x0d8 > usage code to this new keycode. Additionally hid-debug is adjusted to > recognize this new usage code as well. > > Signed-off-by: William Mahon > --- > > drivers/hid/hid-debug.c | 1 + > drivers/hid/hid-input.c | 1 + > include/uapi/linux/input-event-codes.h | 2 ++ > 3 files changed, 4 insertions(+) > > diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c > index 26c31d759914..8aa68416b1d7 100644 > --- a/drivers/hid/hid-debug.c > +++ b/drivers/hid/hid-debug.c > @@ -969,6 +969,7 @@ static const char *keys[KEY_MAX + 1] = { > [KEY_ASSISTANT] = "Assistant", > [KEY_KBD_LAYOUT_NEXT] = "KbdLayoutNext", > [KEY_EMOJI_PICKER] = "EmojiPicker", > + [KEY_DICTATE] = "Dictate", > [KEY_BRIGHTNESS_MIN] = "BrightnessMin", > [KEY_BRIGHTNESS_MAX] = "BrightnessMax", > [KEY_BRIGHTNESS_AUTO] = "BrightnessAuto", > diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c > index 112901d2d8d2..0c6c6db942ca 100644 > --- a/drivers/hid/hid-input.c > +++ b/drivers/hid/hid-input.c > @@ -992,6 +992,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel > case 0x0cd: map_key_clear(KEY_PLAYPAUSE); break; > case 0x0cf: map_key_clear(KEY_VOICECOMMAND); break; > > + case 0x0d8: map_key_clear(KEY_DICTATE); break; > case 0x0d9: map_key_clear(KEY_EMOJI_PICKER); break; > > case 0x0e0: map_abs_clear(ABS_VOLUME); break; > diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h > index 225ec87d4f22..12246594891c 100644 > --- a/include/uapi/linux/input-event-codes.h > +++ b/include/uapi/linux/input-event-codes.h > @@ -735,6 +735,8 @@ > #define KEY_KBD_LCD_MENU4 0x2bb > #define KEY_KBD_LCD_MENU5 0x2bc > > +#define KEY_DICTATE 0x27b > + The list should be sorted in order of evdev code, so KEY_DICTATE should go just below KEY_SELECTIVE_SCREENSHOT. > #define BTN_TRIGGER_HAPPY 0x2c0 > #define BTN_TRIGGER_HAPPY1 0x2c0 > #define BTN_TRIGGER_HAPPY2 0x2c1 > -- > 2.35.1.265.g69c8d7142f-goog >