touch is more snappy, nice

This commit is contained in:
Jonathan Bosson
2017-04-06 14:06:40 -06:00
parent 4416707931
commit cbc8a2cb7e
4 changed files with 51 additions and 31 deletions

View File

@@ -76,6 +76,7 @@ bool TouchModule::gotNewInput() {
TuioCursor c = ear->getTap();
list.push_back(c);
lastProcessed.push_back(std::make_pair(c.getSessionID(), c.getPath().back()));
touch->tap();
return true;
}
@@ -85,7 +86,9 @@ bool TouchModule::gotNewInput() {
for_each(lastProcessed.begin(), lastProcessed.end(), [this, &newInput](Point& p) {
std::vector<TuioCursor>::iterator cursor = find_if(list.begin(), list.end(), [&p](const TuioCursor& c) { return c.getSessionID() == p.first; });
double now = cursor->getPath().back().getTuioTime().getTotalMilliseconds();
if (p.second.getTuioTime().getTotalMilliseconds() == now || !cursor->isMoving())
if (!cursor->isMoving())
newInput = true;
else if (p.second.getTuioTime().getTotalMilliseconds() == now)
newInput = false;
});
return newInput;