Closed fernandojsg closed 6 years ago
Proposal:
// To be exposed by the application var inputActions = { default: { changeTask: { label: 'Change task' }, testlog: { label: 'Test Log' } }, task1: { changeTask: { label: 'Change task' }, testlog_task1: { label: 'Test Log Task 1' } } } AFRAME.registerInputActions(inputActions); // Could be defined by default by the app or the user, custom UI, external request, etc. var mappings = { default: { common: { triggerdown: 'testlog' }, 'vive-controls': { gripdown: 'changeTask', trackpaddown: 'testlog2' }, 'daydream-controls': { trackpaddown: 'testlog' }, 'oculus-touch-controls': { abuttondown: 'changeTask' }, 'windows-motion-controls': { gripdown: 'changeTask' }, keyboard: { 't_up': 'testlog', 'c_up': 'changeTask' } }, task1: { 'vive-controls': { triggerdown: 'testlog_task1', gripdown: 'changeTask' }, 'daydream-controls': { trackpaddown: 'testlog_task1' }, 'oculus-touch-controls': { triggerdown: 'testlog_task1', abuttondown: 'changeTask' }, 'windows-motion-controls': { triggerdown: 'testlog_task1', gripdown: 'changeTask' }, keyboard: { 'y_up': 'testlog_task1', 'c_up': 'changeTask' } } }; AFRAME.registerInputMappings(mappings);
This looks awesome. Only thing I would change is we had discussed getting rid of "common" and adding an explicit call to AFRAME.currentInputState = "default" or maybe AFRAME.currentActionSet = "default"
AFRAME.currentInputState = "default"
AFRAME.currentActionSet = "default"
Proposal: