Device motion events based gesture detector