1. A handheld device, comprising: inertial sensors including a gyroscope and an accelerometer for providing data related to a trajectory of a movement of the handheld device; and a processor coupled to the handheld device and operational in a training mode and a recognition mode, wherein in the training mode, the processor receives the data from the inertial sensors, converts the data into a first set of values corresponding to a first plurality of discreet features, associate the first set of values with a command or a character, and stores the first set of values and the command or character in a training database, and wherein in the recognition mode, the processor receives the data from the inertial sensors, converts the data into a second set of values corresponding to a plurality of second discreet features, compares the second set of values to a plurality of training sets of values in the training device including the second set of values, matches the first set of values to the second set of values, and executes the command or displaying the character.