-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hand-controls: also emit the raw gesture event #4722
base: master
Are you sure you want to change the base?
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