Gesture Implementation

Since our game is targeted for touchscreen mobile devices, I’ve started looking at making [FONT=Courier New]FGestureRecognizer more robust so that it supports many of the common touchscreen gestures that aren’t already part of the engine. I’ve declared new keys for each of the gestures I’m planning to add to [FONT=Courier New]InputCoreTypes.

While doing this, something occurred to me: All of the existing gestures are declared with just one flag – [FONT=Courier New]FKeyDetails::NotBlueprintBindableKey – but these are fairly simple gestures that either happened or didn’t happen. They’re roughly equivalent to actions (e.g. buttons), not axes (e.g. joysticks)

But, while many of the new gestures I’m doing fit nicely into this model, a few that I’d like to do would need to pass information to the delegate and function more like an axis. For example, a two-finger rotate gesture would need to communicate how much rotation has happened since the last time it was called. A pan gesture needs to be able to pass along how much movement on the x and y axes has happened since the last time the delegate was called.

I’m trying to figure out the best approach for these more complex gesturess. Can I just declare the gesture keys as [FONT=Courier New]FKeyDetails::NotBlueprintBindableKey | FKeyDetails::VectorAxis or would it be best to come up with a new flag altogether for these types of gestures.

This is my first time working this far down in the engine, so if anyone has any suggestions or advice on the best way to implement this, I’d appreciate hearing it.