Closed fernandojsg closed 6 years ago
Hmm, hand is a property of the input device, not the input event or the action, seems like it should be included with the input device somehow. Maye use something like attribute selector syntax:
{
"vive-controls[hand='left']": { ... }, // binds only to events on vive-controls components with hand property set to left
"vive-controls[hand='right": { ... } // binds only to events on vive-controls components with hand property set to right
"vive-controls": { ... } // binds to any event on a vive-controls component
}
This prevents us from hardcoding the idea of handedness and just gives us the ability to more selectively filter the event sources we are binding to.
Yep initially my first thought was about doing something on the left side like vive-controls@left
but I like more the idea of having a attribute filter just in case that we'll have any other attributes ni the futures intead of just handedness.
What do you think @dmarcos ?
I do not think creating a DSL is not a good way to go. You have to document, parse, handle errors, there’s a learning curve and it is ugly 🙂. What other attributes you see besides handennes?
As initially @dmarcos proposed on https://github.com/fernandojsg/aframe-input-mapping-component/issues/3#issuecomment-338308387
If we don't specify hand (object) it will just apply that action to both hands:
Both hands it will apply each action to each hand:
Just one hand, it will apply the specific action to one hand and the other won't have any action (Unless we'll rewrite it in controller' specific section: