hand-controls: also emit the raw gesture event#4722
hand-controls: also emit the raw gesture event#4722Elettrotecnica wants to merge 1 commit intoaframevr:masterfrom
Conversation
…ues, whenever a gesture is performed
|
Thanks. Not sure yet if this should be part of |
|
Another note. This is emitting a new event |
|
Thanks for your feedback. Something that would work out for me is also that the events triggered inside hand-controls would span through the whole set of supported gestures. Right now 3 gestures would emit (at least) an event: But the total number of gestures is 6: The mention of "public events" makes me think there might be a reason for it, but I am no expert. Of course I would then need to retranslate the event name to the original gesture (e.g. "pistol" -> "thumb up"), hence the original idea of emitting just the raw gesture. For my use case I am not actually interested in the lastGesture, the current one is enough (and I can always get the last one from my custom component). Depending on what you prefer I could come with a change that removes the lastGesture from the event, or a proposal for emitting also the remaining gestures. All the best |
|
Just checking on this PR as I am trying to move away from maintaining a fork of aframe just for a couple of features. Most of them are already in custom components, but this one in particular would be tricky to rework that way without loads of duplication. I suggest to further simplify the commit so that the one line becomes this:
This enables my use case and IMHO makes sense in general, as gives the developer a chance to react to the full spectrum of gesture events. Any contraindication you see with this? All the best |
In my use case, I have created a custom component that is just a pair of hands that receive their position and gesture from a network backend. My need is that of mirroring whatever gesture has been emitted by a hand-control enabled entity, send it through the network and let my avatar's "remote hands" play the gesture to my peers.
I could immagine though, that other people might find useful to handle any kind of supported gesture, and in the code I have realized there is sometimes the need to know from which gesture we come from, therefore I have also added the lastGesture in the event payload.
All the best