summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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),