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
48fbec2e
Commit
48fbec2e
authored
Jun 04, 2012
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Applied pep8.
parent
31a4bae6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
tests/draw.py
tests/draw.py
+4
-1
tests/parse_arguments.py
tests/parse_arguments.py
+4
-4
tests/tap.py
tests/tap.py
+2
-0
No files found.
tests/draw.py
View file @
48fbec2e
...
@@ -118,7 +118,8 @@ def update():
...
@@ -118,7 +118,8 @@ def update():
end_x
=
x
end_x
=
x
dtap
[
0
]
-=
BEAM_INCREMENT
dtap
[
0
]
-=
BEAM_INCREMENT
pygame
.
draw
.
line
(
screen
,
BEAM_COLOR
,
(
start_x
,
y
),
(
end_x
,
y
),
BEAM_WIDTH
)
pygame
.
draw
.
line
(
screen
,
BEAM_COLOR
,
(
start_x
,
y
),
(
end_x
,
y
),
BEAM_WIDTH
)
# Update canvas
# Update canvas
pygame
.
display
.
flip
()
pygame
.
display
.
flip
()
...
@@ -134,10 +135,12 @@ def rotate(gesture):
...
@@ -134,10 +135,12 @@ def rotate(gesture):
global
angle
global
angle
angle
+=
gesture
.
get_angle
()
angle
+=
gesture
.
get_angle
()
def
pinch
(
gesture
):
def
pinch
(
gesture
):
global
scale
global
scale
scale
=
min
(
scale
*
gesture
.
get_scale
(),
MAX_SCALE
)
scale
=
min
(
scale
*
gesture
.
get_scale
(),
MAX_SCALE
)
transform
=
TransformationTracker
(
win
)
transform
=
TransformationTracker
(
win
)
transform
.
rotate
(
rotate
)
transform
.
rotate
(
rotate
)
transform
.
pinch
(
pinch
)
transform
.
pinch
(
pinch
)
...
...
tests/parse_arguments.py
View file @
48fbec2e
...
@@ -6,14 +6,14 @@ from src.logger import Logger
...
@@ -6,14 +6,14 @@ from src.logger import Logger
# Parse arguments
# Parse arguments
def
create_parser
():
def
create_parser
():
parser
=
argparse
.
ArgumentParser
(
description
=
'Basic test program for
usage
'
parser
=
argparse
.
ArgumentParser
(
description
=
'Basic test program for '
'of multi-touch API.'
)
'
usage
of multi-touch API.'
)
parser
.
add_argument
(
'--log'
,
metavar
=
'LOG_LEVEL'
,
default
=
'INFO'
,
parser
.
add_argument
(
'--log'
,
metavar
=
'LOG_LEVEL'
,
default
=
'INFO'
,
choices
=
[
'DEBUG'
,
'INFO'
,
'WARNING'
],
choices
=
[
'DEBUG'
,
'INFO'
,
'WARNING'
],
help
=
'set log level (defaults to INFO)'
)
help
=
'set log level (defaults to INFO)'
)
parser
.
add_argument
(
'--logfile'
,
metavar
=
'FILENAME'
,
parser
.
add_argument
(
'--logfile'
,
metavar
=
'FILENAME'
,
help
=
'filename for the log file (the log is printed
to
'
help
=
'filename for the log file (the log is printed '
'stdout by default)'
)
'
to
stdout by default)'
)
return
parser
return
parser
...
...
tests/tap.py
View file @
48fbec2e
...
@@ -18,9 +18,11 @@ win = FullscreenWindow(server=server)
...
@@ -18,9 +18,11 @@ win = FullscreenWindow(server=server)
# Add tracker and handlers
# Add tracker and handlers
tracker
=
TapTracker
(
win
)
tracker
=
TapTracker
(
win
)
def
handler
(
gesture
):
def
handler
(
gesture
):
pass
pass
tracker
.
tap
(
handler
)
tracker
.
tap
(
handler
)
tracker
.
single_tap
(
handler
)
tracker
.
single_tap
(
handler
)
tracker
.
double_tap
(
handler
)
tracker
.
double_tap
(
handler
)
...
...
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