#!/usr/bin/python
''' DON'T TOUCH THESE FIRST LINES! '''
''' ============================== '''
from PyoConnect import *
myo = Myo(sys.argv[1] if len(sys.argv) >= 2 else None) 
''' ============================== '''

''' OK, edit below to make your own fancy script ^.^ '''

# Edit here:




def onPoseEdge(pose, edge):
	# the next IF will be true for any LibreOffice product
	if myo.title_contains("LibreOffice"): 
		if (edge == "on"): # only check for new poses
			if (myo.getPoseSide() == "waveRight"): # next slide
				myo.keyboard("right_arrow","press","")
			if (myo.getPoseSide() == "waveLeft"): # prev slide
				myo.keyboard("left_arrow","press","")
	



# Stop editting

# Comment out below the events you are not using
myo.onPoseEdge = onPoseEdge

''' DON'T TOUCH BELOW THIS LINE! '''
''' ============================ '''
myo.connect()
while True:
	myo.run()
	myo.tick()
