Commit 35a46583 authored by Taddeus Kroes's avatar Taddeus Kroes

Source code cleanup.

parent d25c050b
......@@ -128,28 +128,27 @@ def rotate(event):
def pinch(event):
global scale
scale = max(scale * event.amount, MAX_SCALE)
scale = min(scale * event.amount, MAX_SCALE)
# Start touch event listener in separate thread
listener = MultiTouchListener(verbose=0, tuio_verbose=0)
listener = MultiTouchListener(verbose=1, tuio_verbose=0)
listener.bind('rotate', rotate)
#listener.bind('pinch', pinch)
listener.bind('pinch', pinch)
listener.bind('tap', lambda e: taps.append([coord(*e.xy), FINGER_RADIUS]))
listener.bind('single_tap', lambda e: dtaps.append(list(coord(*e.xy)) + [1]))
listener.bind('double_tap', lambda e: dtaps.append(list(coord(*e.xy)) + [0]))
listener.start(threaded=True)
# Start GUI event loop
import sys
try:
while True:
for e in pygame.event.get():
if e.type == pygame.QUIT or (e.type == pygame.KEYDOWN
and e.key == 113):
sys.exit()
def is_quit_event(e):
return e.type == pygame.QUIT \
or (e.type == pygame.KEYDOWN and e.key == ord('q'))
try:
# Start GUI event loop
while not any(filter(is_quit_event, pygame.event.get())):
update()
except KeyboardInterrupt:
pass
......
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