1. An electronic device for gesture-based key input, comprising: a camera; a display configured to display a virtual keyboard; and a controller configured to: set a three-dimensional (3-D) input region, corresponding to the displayed virtual keyboard, according to a typing mode selected from among a single-hand typing mode and a double-hand typing mode, recognize a gesture for the 3-D input region, detected through the camera, and obtain a key input according to the recognized gesture, wherein the controller controls an attribute of the 3-D input region according to the selected typing mode, wherein the attribute of the 3-D input region comprises a size of the 3-D input region, a position of the 3-D input region, and a moving distance on the virtual keyboard according to a movement of the hand in the 3-D input region, and wherein the controller sets the moving distance on the virtual keyboard according to the movement of the hand in the 3-D input region so that the moving distance is smaller when the double-hand typing mode is selected than when the single-hand typing mode is selected.