A motion controlled handheld device includes a display having a viewable
surface and operable to generate an image and a gesture database
maintaining a plurality of gestures. Each gesture is defined by a motion
of the device with respect to a first position of the device. The device
includes a motion detection module operable to detect motion of the
handheld device within three dimensions and to identify components of the
motion in relation to the viewable surface. The device also includes a
control module operable to detect an indication to record a new gesture,
detect a stabilization of the components of the motion of the device,
upon detecting the stabilization, determine a base reference position,
record movement of the device with respect to the base reference
position, detect an indication to stop recording the new gesture, define
the new gesture using the recorded movement of the device with respect to
the base reference position, and store the new gesture in the gesture
database.