PdParty icon indicating copy to clipboard operation
PdParty copied to clipboard

Detect Touch Radius?

Open korakios opened this issue 5 years ago • 2 comments

Hi, is it possible to detect the radius of the touch on iOS ?

korakios avatar Nov 05 '20 10:11 korakios

Not currently. The #touch events are simple positions and type. You'd like the radius of the "finger blob"?

danomatika avatar Nov 05 '20 10:11 danomatika

I could imagine sending additional context info such as touch radius with the #touch if a control message is sent to #pdparty requesting it. This way the default would keep the old type so as not to break any existing projects which use [unpack] to parse the received messages.

Something like:

[touch extra 1<
|
[s #pdparty]

To turn on extra info for #touch events.

danomatika avatar Nov 05 '20 10:11 danomatika

Latest commit adds radius and force to the #touch message:

[r #touch] eventType id x y radius force: multitouch event

  • eventType: symbol "down", "xy" (move), or "up"
  • id: persistent touch id
  • x: x position, normalized 0-1 except for RjDj scenes which use 0-320
  • y: y position, normalized 0-1 except for RjDj scenes which use 0-320
  • radius: finger/stylus radius in points (pixels)
  • force: force into screen, normalized 0-1

This shouldn't break anything as [unpack] silently drops extra list items.

danomatika avatar Nov 26 '22 06:11 danomatika

This feature is in the PdParty 1.3.0 beta6 build and now needs to be enabled. Send #pdparty touch extended 1 when the patch is loaded.

You can the it out by joining the 1.3.0 beta until I can make a proper release. Install the free TestFlight app on your iDevice, then open this TestFlight link:

https://testflight.apple.com/join/17ZZ5AC7

danomatika avatar Nov 30 '22 04:11 danomatika