The open source OpenXR runtime

a/bindings: JSON schema for bindings

authored by

Ryan Pavlik and committed by
Jakob Bornecrantz
0c8d78fe 2d056e66

+222
+1
src/xrt/auxiliary/bindings/bindings.json
··· 1 1 { 2 + "$schema": "./bindings.schema.json", 2 3 "profiles": { 3 4 "/interaction_profiles/khr/simple_controller": { 4 5 "title": "Khronos Simple Controller",
+218
src/xrt/auxiliary/bindings/bindings.schema.json
··· 1 + { 2 + "$schema": "http://json-schema.org/draft-07/schema", 3 + "definitions": { 4 + "profileType": { 5 + "title": "Type of device", 6 + "type": "string", 7 + "enum": [ 8 + "tracked_controller", 9 + "untracked_controller", 10 + "tracked_hmd" 11 + ] 12 + }, 13 + "subpathType": { 14 + "title": "Type of an input/output sub-path", 15 + "type": "string", 16 + "enum": [ 17 + "button", 18 + "joystick", 19 + "pose", 20 + "trackpad", 21 + "trigger", 22 + "vibration" 23 + ] 24 + }, 25 + "componentNames": { 26 + "title": "Name of an input/output component", 27 + "type": "string", 28 + "enum": [ 29 + "click", 30 + "touch", 31 + "position", 32 + "value", 33 + "haptic", 34 + "force", 35 + "pose" 36 + ] 37 + }, 38 + "subActionPathName": { 39 + "title": "Sub-action path", 40 + "type": "string", 41 + "enum": [ 42 + "/user/hand/left", 43 + "/user/hand/right", 44 + "/user/head", 45 + "/user/gamepad" 46 + ] 47 + }, 48 + "steamVrControllerType": { 49 + "title": "Controller type constant for SteamVR", 50 + "type": "string", 51 + "enum": [ 52 + "gamepad", 53 + "holographic_controller", 54 + "khr_simple_controller", 55 + "knuckles", 56 + "oculus_touch", 57 + "vive_controller", 58 + "vive_pro" 59 + ] 60 + }, 61 + "monadoDeviceName": { 62 + "type": "string", 63 + "pattern": "^XRT_DEVICE_([A-Z0-9_]+)$" 64 + }, 65 + "monadoBindingDefine": { 66 + "type": "string", 67 + "pattern": "^XRT_(INPUT|OUTPUT)_([A-Z0-9_]+)$" 68 + }, 69 + "monadoBindings": { 70 + "title": "Components and their Monado define", 71 + "description": "The keys/property names here must match the list of components on this path", 72 + "type": "object", 73 + "$comment": "Keep properties in sync with #/definitions/componentNames - not using that in propertyNames for the sake of json-editor", 74 + "properties": { 75 + "click": { 76 + "$ref": "#/definitions/monadoBindingDefine" 77 + }, 78 + "touch": { 79 + "$ref": "#/definitions/monadoBindingDefine" 80 + }, 81 + "position": { 82 + "$ref": "#/definitions/monadoBindingDefine" 83 + }, 84 + "value": { 85 + "$ref": "#/definitions/monadoBindingDefine" 86 + }, 87 + "haptic": { 88 + "$ref": "#/definitions/monadoBindingDefine" 89 + }, 90 + "force": { 91 + "$ref": "#/definitions/monadoBindingDefine" 92 + }, 93 + "pose": { 94 + "$ref": "#/definitions/monadoBindingDefine" 95 + } 96 + } 97 + }, 98 + "dpadEmulation": { 99 + "title": "Controlling input mapping to d-pad", 100 + "type": "object", 101 + "required": [ 102 + "position", 103 + "center" 104 + ], 105 + "properties": { 106 + "position": { 107 + "title": "The input component to associate with dpad position", 108 + "$ref": "#/definitions/componentNames" 109 + }, 110 + "center": { 111 + "title": "Provide center zone in dpad?", 112 + "description": "True for touchpads, false for joysticks", 113 + "type": "boolean" 114 + }, 115 + "activate": { 116 + "allOf": [ 117 + { 118 + "title": "The input component to associate with dpad activation" 119 + }, 120 + { 121 + "$ref": "#/definitions/componentNames" 122 + } 123 + ] 124 + } 125 + } 126 + }, 127 + "subpathData": { 128 + "description": "Data for a single sub-path of an interaction profile", 129 + "type": "object", 130 + "properties": { 131 + "type": { 132 + "$ref": "#/definitions/subpathType" 133 + }, 134 + "localized_name": { 135 + "type": "string", 136 + "title": "Human-readable string for this input/output" 137 + }, 138 + "components": { 139 + "type": "array", 140 + "title": "Components on this path", 141 + "items": { 142 + "$ref": "#/definitions/componentNames" 143 + }, 144 + "minItems": 1 145 + }, 146 + "monado_bindings": { 147 + "$ref": "#/definitions/monadoBindings" 148 + }, 149 + "dpad_emulation": { 150 + "$ref": "#/definitions/dpadEmulation" 151 + }, 152 + "steamvr_path": { 153 + "title": "Path in SteamVR for this data", 154 + "type": "string" 155 + } 156 + } 157 + }, 158 + "profileData": { 159 + "title": "Interaction Profile Data", 160 + "type": "object", 161 + "required": [ 162 + "title", 163 + "type", 164 + "monado_device", 165 + "subaction_paths", 166 + "subpaths" 167 + ], 168 + "properties": { 169 + "title": { 170 + "title": "Name of the device", 171 + "type": "string" 172 + }, 173 + "type": { 174 + "$ref": "#/definitions/profileType" 175 + }, 176 + "monado_device": { 177 + "title": "Monado define corresponding to this profile", 178 + "$ref": "#/definitions/monadoDeviceName" 179 + }, 180 + "extension": { 181 + "title": "OpenXR extension required to expose this profile", 182 + "type": "string" 183 + }, 184 + "steamvr_controllertype": { 185 + "$ref": "#/definitions/steamVrControllerType" 186 + }, 187 + "subaction_paths": { 188 + "title": "Subaction paths accepted for this profile", 189 + "type": "array", 190 + "items": { 191 + "$ref": "#/definitions/subActionPathName" 192 + } 193 + }, 194 + "subpaths": { 195 + "type": "object", 196 + "title": "Paths provided by this profile", 197 + "propertyNames": { 198 + "pattern": "^(/input/(select|menu|grip|aim|trackpad|system|squeeze|trigger|volume_up|volume_down|mute_mic|thumbrest|home|start|([a-z]+)_mndx|[1-4]|thumbstick(_left|_right)?|view|a|b|x|y|dpad_(up|down|left|right)|shoulder(_left|_right)?))|(/output/haptic(_left|_right|_left_trigger|_right_trigger)?)$" 199 + }, 200 + "additionalProperties": { 201 + "$ref": "#/definitions/subpathData" 202 + } 203 + } 204 + } 205 + } 206 + }, 207 + "type": "object", 208 + "properties": { 209 + "profiles": { 210 + "type": "object", 211 + "patternProperties": { 212 + "^/interaction_profiles/([a-z0-9_]+)/([a-z0-9_]+)$": { 213 + "$ref": "#/definitions/profileData" 214 + } 215 + } 216 + } 217 + } 218 + }
+3
src/xrt/auxiliary/bindings/bindings.schema.json.license
··· 1 + Copyright 2020-2023, Collabora, Ltd. 2 + 3 + SPDX-License-Identifier: BSL-1.0