diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2016-04-25 19:47:49 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2016-04-25 19:47:49 +0200 |
commit | 29d8f1b4e89f31e2f3b448c4d40c6c2518629686 (patch) | |
tree | c6a8631716a45bc8c76a468d02073ba5973a35bb | |
parent | f204350c8b4007f78fe27026740d519ab360dedf (diff) |
HID: added keyboard definition.
-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), |