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
72d93bef
Commit
72d93bef
authored
May 29, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some test scripts.
parent
50f9fec0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
2 deletions
+63
-2
src/__init__.py
src/__init__.py
+0
-2
test.py
test.py
+8
-0
tests/tap.py
tests/tap.py
+55
-0
No files found.
src/__init__.py
View file @
72d93bef
from
events
import
*
from
touch
import
MultiTouchServer
test.py
0 → 100644
View file @
72d93bef
import
os
src_path
=
os
.
path
.
realpath
(
'src'
)
import
sys
sys
.
path
.
insert
(
0
,
src_path
)
del
sys
.
argv
[
0
]
execfile
(
sys
.
argv
[
0
])
tests/tap.py
0 → 100644
View file @
72d93bef
import
argparse
import
logging
from
src.server
import
GestureServer
from
src.window
import
FullscreenWindow
from
src.trackers.tap
import
TapTracker
from
src.logger
import
Logger
# Parse arguments
parser
=
argparse
.
ArgumentParser
(
description
=
'Basic test program for usage '
'of multi-touch API.'
)
parser
.
add_argument
(
'--log'
,
metavar
=
'LOG_LEVEL'
,
default
=
'INFO'
,
choices
=
[
'DEBUG'
,
'INFO'
,
'WARNING'
],
help
=
'set log level (defaults to INFO)'
)
parser
.
add_argument
(
'--logfile'
,
metavar
=
'FILENAME'
,
help
=
'filename for the log file (the log is printed to '
'stdout by default)'
)
args
=
parser
.
parse_args
()
# Configure logger
log_config
=
{
'level'
:
getattr
(
logging
,
args
.
log
)}
if
args
.
logfile
:
log_config
[
'filename'
]
=
args
.
logfile
Logger
.
configure
(
**
log_config
)
# Create server
server
=
GestureServer
()
# Create a window to add trackers to
win
=
FullscreenWindow
(
server
=
server
)
# Above is short for:
#win = FullscreenWindow()
#server.add_window(win)
# Add tracker and handlers
tracker
=
TapTracker
(
win
)
def
handler
(
gesture
):
pass
#print 'handler:', gesture
tracker
.
bind
(
'tap'
,
handler
)
tracker
.
bind
(
'single_tap'
,
handler
)
tracker
.
bind
(
'double_tap'
,
handler
)
# Start listening to TUIO events
try
:
server
.
start
()
except
KeyboardInterrupt
:
server
.
stop
()
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