code to receive a shake event