diff options
Diffstat (limited to 'usb')
-rw-r--r-- | usb/hid.h | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -85,6 +85,7 @@ namespace DesktopUsage { enum _8 : uint8_t { Undefined, Gamepad = 0x05, + Keyboard, X = 0x30, Y, Z, @@ -175,6 +176,24 @@ constexpr auto gamepad(R... r) -> decltype( ); } +template <typename... R> +constexpr auto keyboard(R... r) -> decltype( + pack( + usage_page(UsagePage::Desktop), + usage(DesktopUsage::Keyboard), + collection(Collection::Application, + r... + ) + )) { + return pack( + usage_page(UsagePage::Desktop), + usage(DesktopUsage::Keyboard), + collection(Collection::Application, + r... + ) + ); +} + constexpr auto buttons(uint8_t num) -> decltype( pack( usage_page(UsagePage::Button), |