summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2016-04-25 19:47:49 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2016-04-25 19:47:49 +0200
commit29d8f1b4e89f31e2f3b448c4d40c6c2518629686 (patch)
treec6a8631716a45bc8c76a468d02073ba5973a35bb
parentf204350c8b4007f78fe27026740d519ab360dedf (diff)
HID: added keyboard definition.
-rw-r--r--usb/hid.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/usb/hid.h b/usb/hid.h
index 1d3c8c1..3501bd5 100644
--- a/usb/hid.h
+++ b/usb/hid.h
@@ -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),