A method for processing motion of a portable electronic device to control the portable electronic device, the method comprising: receiving, on the portable electronic device, sensed motion data derived from motion sensors (26, 28) of the portable electronic device, wherein the sensed motion data is based on movement of the portable electronic device in space, the motion sensors providing six-axis motion sensing and including at least three rotational motion sensors and at least three accelerometers; determining, on the portable electronic device, a particular operating mode that is active while the movement of the portable electronic device occurs, wherein the particular operating mode is one of a plurality of different operating modes available in the operation of the portable electronic device; recognizing, on the portable electronic device, a shake gesture along an axis from the motion data; wherein the shake gesture requires a magnitude that is at least a threshold level above a background noise level so that intentional shaking can be distinguished from unintentional shaking; wherein the shake gesture is defined to have a predetermined number of direction changes; wherein recognizing the shake gesture comprises delaying triggering the gesture until device movement settles below a threshold close to zero and then selecting a highest peak of the motion data for gesture recognition to determine the axis for the shake gesture; wherein the shake gesture is recognized from a set of a plurality of motion gestures that are available for recognition in the active operating mode of the portable electronic device, and wherein each of the different operating modes of the portable electronic device, when active, has a different set of motion gestures available for recognition; and changing one or more states of the portable electronic device based on the recognized shake gesture, including changing output of a display screen on the portable electronic device. receiving, on the portable electronic device, sensed motion data derived from motion sensors (26, 28) of the portable electronic device, wherein the sensed motion data is based on movement of the portable electronic device in space, the motion sensors providing six-axis motion sensing and including at least three rotational motion sensors and at least three accelerometers; determining, on the portable electronic device, a particular operating mode that is active while the movement of the portable electronic device occurs, wherein the particular operating mode is one of a plurality of different operating modes available in the operation of the portable electronic device; recognizing, on the portable electronic device, a shake gesture along an axis from the motion data; wherein the shake gesture requires a magnitude that is at least a threshold level above a background noise level so that intentional shaking can be distinguished from unintentional shaking; wherein the shake gesture is defined to have a predetermined number of direction changes; wherein recognizing the shake gesture comprises delaying triggering the gesture until device movement settles below a threshold close to zero and then selecting a highest peak of the motion data for gesture recognition to determine the axis for the shake gesture; wherein the shake gesture is recognized from a set of a plurality of motion gestures that are available for recognition in the active operating mode of the portable electronic device, and wherein each of the different operating modes of the portable electronic device, when active, has a different set of motion gestures available for recognition; and changing one or more states of the portable electronic device based on the recognized shake gesture, including changing output of a display screen on the portable electronic device.