Mixedrealitytoolkit-unity: vNext Task: Add input action rules to controller events

Created on 18 Aug 2018  路  2Comments  路  Source: microsoft/MixedRealityToolkit-Unity

Overview

It was suggested that we may also want to call actions for when inputs reach their max/min values or have a specific value.

For example the Xbox Dpad outputs a single Vector 2 value, where as Users want to be able to assign different actions based on the Dpad up / DPad down / etc

This however translate differently based on what the input is, so the user might want a different action for the directions on a touchpad, e.g. N / NW / W / SW / S / SE / E / NE

Currently this is only way to process the directions is in the handler, as shown below.

public void OnPositionInputChanged(InputEventData<Vector2> eventData)
{
    if(eventData.InputData.x == 1)
    {
        // Right Press
    }

    if(eventData.InputData.x == -1)
    {
        // Left Press
    }

    if(eventData.InputData.y == 1)
    {
        // Up Press
    }

    if(eventData.InputData.y == -1)
    {
        // Down Press
    }
}

Ideally, there should be an editor configuration screen to be able to add the ability to configure these translations / re-directions of input actions

Requires

  • A new scriptable profile to define rules for input actions (Input Action X with Value Y raises Input Action Z)
  • Input Handlers should read from the rules for any configured rules and raise the corresponding event.
  • Code documentation
  • Supporting user documentation

Acceptance Criteria

  • [x] I can configure 4 or more different input actions for each direction, from a input action received from a Dpad (Dual Axis)
  • [x] I can configure 8 or more different input actions for each direction, from a input action received from a Thumbstick (Dual Axis)
  • [x] I can configure 8 or more different input actions for each direction, from a input action received from a Touchpad (Dual Axis)
  • [x] I can configure different Input actions for pressure received from a single axis / float input action
  • [x] I can configure different Input actions for rotations received from a 3Dof or 6Dof input action
  • [x] I can configure different Input actions for positions received from a 3Dof or 6Dof input action
Input System

Most helpful comment

Updated Task to be a little more generic. Aim is to provide a "Helper" editor component for users who "don't code", but want a way to generate new actions based on an existing input actions value

All 2 comments

Updated Task to be a little more generic. Aim is to provide a "Helper" editor component for users who "don't code", but want a way to generate new actions based on an existing input actions value

Revised task based of (post)shiproom discussions on the implementation.

Was this page helpful?
0 / 5 - 0 ratings