Commit 98d85613 authored by UVA Multi-touch's avatar UVA Multi-touch

Fixed obsolete point down issue.

parent 7ac935c6
...@@ -35,15 +35,18 @@ class TuioServer2D(Logger): ...@@ -35,15 +35,18 @@ class TuioServer2D(Logger):
% (surface, tags, data, source), 2) % (surface, tags, data, source), 2)
msg_type = data[0] msg_type = data[0]
# FIXME: Ignore obj/blb events?
if surface != 'cur':
return
if msg_type == 'alive': if msg_type == 'alive':
alive = set(data[1:]) alive = set(data[1:])
released = self.alive - alive released = self.alive - alive
self.alive = alive self.alive = alive
self.down -= released
self.down -= released
if released: if released:
self.log('Released %s.' % ', '.join(map(str, released)), 2) self.log('Released %s.' % ', '.join(map(str, released)))
self.down -= released
for sid in released: for sid in released:
self.handler_obj.point_up(sid) self.handler_obj.point_up(sid)
...@@ -56,12 +59,12 @@ class TuioServer2D(Logger): ...@@ -56,12 +59,12 @@ class TuioServer2D(Logger):
# Check if 'point_down' has already been triggered. If so, trigger # Check if 'point_down' has already been triggered. If so, trigger
# a 'point_move' event instead # a 'point_move' event instead
if sid in self.down: if sid in self.down:
self.log('Moved %d to (%s, %s).' % (sid, x, y), 2) self.log('Moved %d to (%s, %s).' % (sid, x, y))
self.handler_obj.point_move(sid, x, y) self.handler_obj.point_move(sid, x, y)
else: else:
self.log('Down %d at (%s, %s).' % (sid, x, y), 2) self.log('Down %d at (%s, %s).' % (sid, x, y))
self.handler_obj.point_down(sid, x, y)
self.down.add(sid) self.down.add(sid)
self.handler_obj.point_down(sid, x, y)
def start(self): def start(self):
self.log('Starting OSC server') self.log('Starting OSC server')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment