Base: Main event loop, provider creation, window management...
PyMT Usage: %s [OPTION...]
-h, --help prints this mesage
-f, --fullscreen force run in fullscreen
-k, --fake-fullscreen force run in 'fake' fullscreen (no border mode)
-a, --auto-fullscreen force run in 'auto' fullscreen (no resolution change)
-w, --windowed force run in window
-p, --provider id:provider[,options] add a provider (eg: ccvtable1:tuio,192.168.0.1:3333)
-F, --fps show fps in window
-m mod, --module=mod activate a module (use "list" to get available module)
-s, --save save current PyMT configuration
--size=640x480 size of window
Static main function that starts the application loop. You got some magic things, if you are using argument like this :
| Parameters : |
|
|---|
Stop the current application by leaving the main loop
Return the last delta between old and new frame.
Return the list of all current touches
Return the default TouchEventLoop object
List of event listeners
Deprecated since version 0.5: This symbol have been renamed to pymt_event_listeners
Return the MTWindow
Set current PyMT window .. warning:
Use it only if you know what you are doing !
'''
Create a event dispatcher, and use it to get all event from PyMT
Without any OpenGL window created.
'''
# prevent window creation
import os
os.environ['PYMT_SHADOW_WINDOW'] = '0'
from pymt import *
# create a class to catch all events
class TouchEventListener:
def dispatch_event(self, event_name, *arguments):
print 'Event dispatched', event_name, 'with', arguments
# append the class to event listeners
pymt_event_listeners.append(TouchEventListener())
# start pymt subsystem
runTouchApp(slave=True)
# now you can run your application,
# and don't forget to update PyMT subsystem
while True:
# update pymt subsystem
getEventLoop().idle()
# do your own thing.
pass