customMotion method for effective event processing