Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
multitouch
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
multitouch
Commits
35a46583
Commit
35a46583
authored
May 18, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Source code cleanup.
parent
d25c050b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
src/draw.py
src/draw.py
+10
-11
No files found.
src/draw.py
View file @
35a46583
...
@@ -128,28 +128,27 @@ def rotate(event):
...
@@ -128,28 +128,27 @@ def rotate(event):
def
pinch
(
event
):
def
pinch
(
event
):
global
scale
global
scale
scale
=
m
ax
(
scale
*
event
.
amount
,
MAX_SCALE
)
scale
=
m
in
(
scale
*
event
.
amount
,
MAX_SCALE
)
# Start touch event listener in separate thread
# 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
(
'rotate'
,
rotate
)
#
listener.bind('pinch', pinch)
listener
.
bind
(
'pinch'
,
pinch
)
listener
.
bind
(
'tap'
,
lambda
e
:
taps
.
append
([
coord
(
*
e
.
xy
),
FINGER_RADIUS
]))
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
(
'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
.
bind
(
'double_tap'
,
lambda
e
:
dtaps
.
append
(
list
(
coord
(
*
e
.
xy
))
+
[
0
]))
listener
.
start
(
threaded
=
True
)
listener
.
start
(
threaded
=
True
)
# Start GUI event loop
import
sys
try
:
def
is_quit_event
(
e
):
while
True
:
return
e
.
type
==
pygame
.
QUIT
\
for
e
in
pygame
.
event
.
get
():
or
(
e
.
type
==
pygame
.
KEYDOWN
and
e
.
key
==
ord
(
'q'
))
if
e
.
type
==
pygame
.
QUIT
or
(
e
.
type
==
pygame
.
KEYDOWN
and
e
.
key
==
113
):
sys
.
exit
()
try
:
# Start GUI event loop
while
not
any
(
filter
(
is_quit_event
,
pygame
.
event
.
get
())):
update
()
update
()
except
KeyboardInterrupt
:
except
KeyboardInterrupt
:
pass
pass
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment