54 json_object *o = NULL;
56 if (json_object_object_get_ex(js,
"uuid", &o))
59 if (json_object_object_get_ex(js,
"position", &o))
62 if (json_object_object_get_ex(js,
"isPressed", &o))
63 interaction.isPressed = json_object_get_boolean(o);
65 if (json_object_object_get_ex(js,
"type", &o))
68 if( json_object_object_get_ex(js,
"origin", &o))
71 if( json_object_object_get_ex(js,
"timestamp", &o))
72 interaction.timestamp = json_object_get_double(o);
74 if( json_object_object_get_ex(js,
"clickCount", &o))
88 json_object *js = json_object_new_object();
92 json_object_object_add(js,
"isPressed", json_object_new_boolean(value.isPressed));
95 json_object_object_add(js,
"timestamp", json_object_new_double(value.timestamp));
190 bool changed =
false;
192 interaction->type = VuoInteractionType_None;
203 interaction->type = (prev.type == VuoInteractionType_Drag || prev.type == VuoInteractionType_DragStart) ? VuoInteractionType_Drag : VuoInteractionType_DragStart;
205 interaction->type = VuoInteractionType_Move;
207 interaction->position = position;
208 interaction->clickCount = 0;
211 if( interaction->isPressed != isPressed )
217 interaction->type = VuoInteractionType_Press;
218 interaction->origin = position;
223 interaction->clickCount = prev.clickCount + 1;
227 interaction->clickCount = 1;
235 if( prev.type == VuoInteractionType_DragStart || prev.type == VuoInteractionType_Drag )
237 interaction->clickCount = 0;
238 interaction->type = VuoInteractionType_DragFinish;
242 interaction->clickCount = prev.clickCount;
243 interaction->type = VuoInteractionType_Click;
247 interaction->clickCount = prev.clickCount;
248 interaction->type = VuoInteractionType_Release;
252 interaction->isPressed = isPressed;