linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Handling of USB "Programmable button" controls as KEY_MACRO# events
@ 2021-05-18 13:21 Thomas Weißschuh
  2021-05-18 13:44 ` Hans de Goede
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Weißschuh @ 2021-05-18 13:21 UTC (permalink / raw)
  To: linux-input, linux-usb, Jiri Kosina, Benjamin Tissoires, Hans de Goede
  Cc: linux-kernel

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/

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

end of thread, other threads:[~2021-05-19 20:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 13:21 Handling of USB "Programmable button" controls as KEY_MACRO# events Thomas Weißschuh
2021-05-18 13:44 ` Hans de Goede
2021-05-19 16:03   ` [PATCH] HID: input: Add support for Programmable Buttons Thomas Weißschuh
2021-05-19 16:13     ` Hans de Goede
2021-05-19 17:11       ` Thomas Weißschuh
2021-05-19 17:43       ` [PATCH v2] " Thomas Weißschuh
2021-05-19 20:01         ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).