From cbeebe6ca462d7840b8120f856981f743731e168 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sat, 9 Apr 2022 16:31:29 +0100 Subject: [PATCH] xrt: Add XRT_GET_INPUT_ID --- src/xrt/include/xrt/xrt_defines.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/xrt/include/xrt/xrt_defines.h b/src/xrt/include/xrt/xrt_defines.h index 719759959..0a065bb3e 100644 --- a/src/xrt/include/xrt/xrt_defines.h +++ b/src/xrt/include/xrt/xrt_defines.h @@ -610,6 +610,17 @@ enum xrt_input_type */ #define XRT_GET_INPUT_TYPE(name) ((enum xrt_input_type)(name & 0xff)) +/*! + * @brief Extract the xrt_input_name id from an xrt_input_name. + * + * @param name A xrt_input_name value + * + * @relates xrt_input_name + * @returns @ref xrt_input_type + * @ingroup xrt_iface + */ +#define XRT_GET_INPUT_ID(name) ((uint32_t)(name >> 8)) + /*! * Every internal input source known to monado with a baked in type. *