Register event listener for shake