DeviceSourceManager for touch inputs

I’ve been migrating to the DeviceSourceManager for my project, so far mouse, keyboard, and game pad work as expected. However when i attempt to use it for touch I end up completely stumped lol

Can anyone guide me through touch inputs with the DSM, such as swipes, position, etc - or has this not been implemented yet? currentState & previousState almost look like tap positions but I’m unaware what I’m actually looking at :sob: as always, thanks for any help provided. I love y’all

For anyone wondering at the moment, my goal is to move a camera with touch inputs - I could default to the old ways but I’d rather have everything working on the same system

Pinging our input champion @Drigax

1 Like

@Ateria, currently we don’t have support for touch gestures like pinch, rotate, longtap etc… however the raw touch position data is available.

I threw together a simple sample of how to use the DeviceSourceManager exclusively to control something like camera rotation:
https://playground.babylonjs.com/#UNLDL9#17

@PolygonalSun was working on a more seamless integration of the DeviceSourceManager into some of our built in functionality like our camera controllers, how is that coming along? It seems that we’re still missing mouse/touch pointer diffs in addition to the raw positions, unless I’m missing something…

We also have some documentation of the general usage of the DeviceSourceManager here:

1 Like

Thank you, I should be able to adapt this to suit my needs. :slight_smile: I really like the idea behind the device source manager, I do hope it extends into other parts of babylon in the future. I’d found the docs on dsm, but wasn’t sure how to use the actual input, especially when it came to touch. :rofl: thank you for your assistance. I love this community. <3

1 Like

@Ateria, glad it helps you! Btw, what mobile browser are you using that allows you to view the javascript console?

It’s called spck editor on Android, free and open-source - no ads :slight_smile: works for testing things before implementing them on the go

1 Like