Skip to content
Snippets Groups Projects
Commit 33dc4f36 authored by Faruk Hammoud's avatar Faruk Hammoud
Browse files

test commpss

parent fdb68119
No related branches found
No related tags found
No related merge requests found
......@@ -50,15 +50,19 @@ void onFlick( float x, float y, float px, float py, float v)
void onPinch(float x, float y, float d)
{
if (d != 0){
Size = constrain(Size+d, 1, 2000);
net.sendPinch(x, y, d);
}
}
void onRotate(float x, float y, float ang)
{
if (ang != 0){
Angle += ang;
net.sendRotation(x, y, ang);
}
}
//these still work if we forward MotionEvents below
void mouseDragged()
......
No preview for this file type
......@@ -9,6 +9,7 @@ class Mobile:
print('Its not my problem')
else:
print('ill handle it!')
print(data)
def on_left_swipe(self):
if self.help:
print('[LEFT SWIPE DETECTED] You can overwrite on_left_swipe to handle it.')
......
......@@ -4,5 +4,5 @@ from time import sleep
c = Controller('a1b2c3')
c.connect()
print('luckly..')
sleep(3)
c.disconnect()
......@@ -30,7 +30,10 @@ def allowed_file(filename):
def multicast(code):
if request.method == 'POST':
content = request.json
print(content)
if not 'id' in content:
print('[PROBLEM]',content)
return jsonify({})
else:
print(code,content['id'])
with app.app_context():
socketio.emit('multicast', request.get_json(), broadcast = True,namespace='/'+code)
......@@ -45,7 +48,7 @@ def confirmReception():
@socketio.on('code')
def handle_code(json, methods=['GET', 'POST']):
print('code received: ' + str(json))
socketio.emit('message', json, callback=confirmReception,namespace='/a1b2c3')
socketio.emit('message', json,namespace='/a1b2c3')
if __name__ == '__main__':
socketio.run(app,debug = True,host = "0.0.0.0",port = 80)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment