The open source OpenXR runtime
at main 64 lines 1.4 kB view raw
1// Copyright 2021, Mateo de Mayo. 2// Copyright 2023, Collabora, Ltd. 3// SPDX-License-Identifier: BSL-1.0 4/*! 5 * @file 6 * @brief Interface to @ref drv_qwerty. 7 * @author Mateo de Mayo <mateodemayo@gmail.com> 8 * @ingroup drv_qwerty 9 */ 10 11#pragma once 12 13#include "xrt/xrt_compiler.h" 14 15 16#ifdef __cplusplus 17extern "C" { 18#endif 19 20 21typedef union SDL_Event SDL_Event; 22 23/*! 24 * @defgroup drv_qwerty Qwerty driver 25 * @ingroup drv 26 * 27 * @brief Driver for emulated HMD and controllers through keyboard and mouse. 28 */ 29 30/*! 31 * @dir drivers/qwerty 32 * 33 * @brief @ref drv_qwerty files. 34 */ 35 36/*! 37 * Process an SDL_Event (like a key press) and dispatches a suitable action 38 * to the appropriate qwerty_device. 39 * 40 * @note A qwerty_controller might not be in use (for example if you have 41 * physical controllers connected), though its memory will be modified by these 42 * events regardless. A qwerty_hmd not in use will not be modified as it never 43 * gets created. 44 * 45 * @ingroup drv_qwerty 46 */ 47void 48qwerty_process_event(struct xrt_device **xdevs, size_t xdev_count, SDL_Event event); 49 50/*! 51 * Create all qwerty devices. 52 * 53 * @ingroup drv_qwerty 54 */ 55xrt_result_t 56qwerty_create_devices(enum u_logging_level log_level, 57 struct xrt_device **out_hmd, 58 struct xrt_device **out_left, 59 struct xrt_device **out_right); 60 61 62#ifdef __cplusplus 63} 64#endif