Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1675361pxj; Wed, 19 May 2021 11:11:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD/pbudeEp5+H8BrgmYafYm4G5YoCAXn1m9chp4kLlSfOtsQk163C5okqPUgzGMXuvF1Tm X-Received: by 2002:a05:6e02:1bc7:: with SMTP id x7mr305186ilv.206.1621447910170; Wed, 19 May 2021 11:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621447910; cv=none; d=google.com; s=arc-20160816; b=OEvTMCjXxNrccA1d5mkVSxzsdmPDx1YB0H2Tdr/g03NIjTrXOuzJKxTpSAdkWLWepQ eTVfYCWTV+8oMiGNqRxVV18Ke1SqAOf0dtDOP3pKBfBiIJ4bPxY/v+v926MpEI7D6n/r 0iXviXFo5EHWGixkWw7wofLLhtsWdMMQHs2v+1AFQhe5aCh3HIkpwsh2kE554VZlGU3L VO0kBJRNZLoWm+gTic6z3pSs3Jvrqgm30eAiz3MOqIzMa1nWP+1RYBJ/P6/OcIRF146Q hcU9mX5LUpJkfYmWqvsKuMWZ4dyK909Yd62vjIrZ3XwGN6Wlqtj0Mf5dTKD31N3V0q/H EqnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:dkim-signature:date; bh=ZZJL/spFPSx7AIAK2vILKaP5tueN2SlMg2bz6eGEcrw=; b=pqxY1/vCzTUCM/NINE1nlLxHJLp3Ik+bW8uzc7CGeWE962hXeC5PQ2pyCLigDp2N/m pubJ/zgFEHccybEAsDv2mH9YdyyTS8oaRn6bgcqy5gpJp94wGGs8gGitoo8CCD8YU96O X1lP4FBtuyqtb1FUzwJ8RafD46jLd2nYadp9LWmztHd8HhwkrH3xruUuHtaxJC+6ClIA 4QPSMTPFCFDz6Z6ESfDjb3Fqc+7J/cHwgd1KdUMNuDLHIVacFwz549VLmYwW8oyLwhQE YGfEAn2i8N9OKE7DfJIRrerKxtKaWdrB1HGOjwJu2DHyZxQsEK8OvvuSheD02AL4L4Ah pw8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=RY7sbvsa; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k64si26958684iof.43.2021.05.19.11.11.37; Wed, 19 May 2021 11:11:50 -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=fail header.i=@weissschuh.net header.s=mail header.b=RY7sbvsa; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349440AbhERNXF (ORCPT + 99 others); Tue, 18 May 2021 09:23:05 -0400 Received: from todd.t-8ch.de ([159.69.126.157]:47981 "EHLO todd.t-8ch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239145AbhERNXE (ORCPT ); Tue, 18 May 2021 09:23:04 -0400 Date: Tue, 18 May 2021 15:21:40 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1621344101; bh=c73kIoBsDpAy+yCZg+mOnr7VdjTq2wMsaBIYMScY8l4=; h=Date:From:To:Cc:Subject:From; b=RY7sbvsayItCmTcrOiNlGHGPirtg8zTW33X5Y9wQXaiUs5BbrPlC0OgWz9M8DA033 VSq/JVpFhGUHh8xLDX0XT9Mp/s67wtCAf9cPgFksTYcdS0eHXRUPJgny3YLOrCCflA L0qWMUXLH2Mp2nXyjYQYhuqN61ZpcC0GIqZRDZ0Y= From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: linux-input@vger.kernel.org, linux-usb@vger.kernel.org, Jiri Kosina , Benjamin Tissoires , Hans de Goede Cc: linux-kernel@vger.kernel.org Subject: Handling of USB "Programmable button" controls as KEY_MACRO# events Message-ID: <6ebbb200-1f2c-450b-8fae-e5e2dd9b6be9@t-8ch.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi everybody, Would it make sense to map the "Programmable Buttons" control from the USB HID Consumer page [0] to the linux event codes KEY_MACRO1 ... KEY_MACRO# ? Those controls are documented in the USB spec as: "The user defines the function of these buttons to control software applications or GUI objects." The KEY_MACRO event codes are documented with: "Some keyboards have keys which do not have a defined meaning, these keys are intended to be programmed / bound to macros by the user." My usecase is the passing of custom keycodes from a programmable keypad (via QMK[1]) to Linux. (This would also need new functionality in QMK itself) Alternatives: * Send Raw HID from QMK * Con: needs a dedicated, nonstandard driver on the host * Use F-Keys * Con: only F13-F19 are usable (F1-F12 are used by normal keyboards, F20-F23 are repurposed with other keys for X11 compat) Possible problems: * There are 65k programmable keys defined by USB but only 30 macro keys are supported by Linux. Thanks, Thomas [0] https://www.usb.org/sites/default/files/hut1_22.pdf#section.15.14 [1] https://qmk.fm/