aframe-input-mapping-component icon indicating copy to clipboard operation
aframe-input-mapping-component copied to clipboard

Consistent naming

Open fernandojsg opened this issue 8 years ago • 0 comments

In every issue or conversation we use completely different naming for each item so it could be nice to have a consistent naming across all the code and conversations so we really understand that we are talking about the same things :D I'm totally open here, if you have suggestion or if you prefer to go for a similar naming as the one used on Steam Controller API, I'm ok with that.

Looking at the current implementation:

  var inputActions = {
    task1: {
      changeTask: { label: 'Change task' },
      logdefault: { label: 'Test Log' },
      logtask1: { label: 'Test Log Task 1' },
      lefthand: { label: 'Left hand' },
      righthand: { label: 'Right hand' },
    },
    task2: {
      changeTask: { label: 'Change task' },
      logtask2: { label: 'Test Log Task 2' }
    }
  }

  AFRAME.registerInputActions(inputActions, 'task1');
  • inputActionsrename toinputActionSet. So currentInputMappingshould be renamed tocurrentInputSet`.
  • task1, task2: actions
  • Each action has a type: digital, analog1d, analog2d, analog3d, pose,...
  var mappings = {
    task1: {
      common: {
        triggerdown: {left: 'lefthand', right: 'righthand'}
      },
      'vive-controls': {
        gripdown: 'changeTask',
        trackpaddownlongpress: 'logdefault'
      },
    },
  • bindings: triggerdown is binded to lefthand.
  • activators: Modifiers of an specific input event: longpress, doubletouch, doublepress.
    behaviours: {
      default: {
        'vive-controls': {
          trackpad: 'dpad'
        }
      }
    },
  • behaviours: Add a custom behaviour to a input element, like dpad to a thumbpad.
  • The mapping from trackpad to dpad is what steam calls mode.

fernandojsg avatar Nov 24 '17 12:11 fernandojsg