From 598c1a3b568c2c38035232ee5257324325b3449e Mon Sep 17 00:00:00 2001 From: Christoph Haag Date: Fri, 16 Apr 2021 16:37:43 +0200 Subject: [PATCH] d/ohmd: Only set output name if there is an output This needs to be revisited after OpenHMD gets a proper API for haptic feedback. closes #119 --- src/xrt/drivers/ohmd/oh_device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xrt/drivers/ohmd/oh_device.c b/src/xrt/drivers/ohmd/oh_device.c index bdd4c518b..89b626bee 100644 --- a/src/xrt/drivers/ohmd/oh_device.c +++ b/src/xrt/drivers/ohmd/oh_device.c @@ -1131,7 +1131,9 @@ create_controller(ohmd_context *ctx, int device_idx, int device_flags, enum xrt_ // in case the hardware is an analog trigger, change the input after a half pulled trigger. ohd->make_trigger_digital = true; - ohd->base.outputs[0].name = XRT_OUTPUT_NAME_SIMPLE_VIBRATION; + if (num_outputs > 0) { + ohd->base.outputs[0].name = XRT_OUTPUT_NAME_SIMPLE_VIBRATION; + } ohd->controls_mapping[OHMD_TRIGGER] = SIMPLE_SELECT_CLICK; ohd->controls_mapping[OHMD_MENU] = SIMPLE_MENU_CLICK;