Detecting touch-force

It appears that on iOS it is possible to get the force of a touch: Apple Developer Documentation

Android seems to support this also: Android Q gets "3D Touch" pressure-sensitivity support - SlashGear

For creation of touchscreen musical instruments, it would be super-valuable to get realtime updates of the force of a touch.

Is it possible to do this with JUCE? And if not, is it in the pipeline?

This is provided via MouseEvent::pressure and MouseEvent::isPressureValid.

1 Like

Thanks!

But how might I continually track the pressure?

Will JUCE deliver a fresh event every time the pressure changes? Or would I need to poll?

Supposing I’m playing a chord, I could have varying pressure on multiple touches.

Wouldn’t I need a fresh touchId for each new touch, and then all updates would reference to that touchId?

Also, can anyone recommend a min-spec/cost iOS/Android tablet that supports pressure-sensitive touches?

I remember (>6) years ago that this feature was discovered in the iOS private/hidden API – it used the surface-area of the touch to infer the pressure. I was among those requesting the iOS devteam to make it public. Does anyone know if this modern “pressure-touch” is a fundamentally different technology? Or has the API simply become public at last?

1 Like