A system implementing a flexible keyboard layout (110, 120, 130, 140, 150, 1102, 1103) for inputting into an electronic device, comprising: an input module, configured to detect a user input from a user, wherein the user input comprises a key entry operation, and wherein the input module is further configured to record data of the key entry operation and output the data to a layout mapping module; the layout mapping module connected to the input module, wherein the layout mapping module is configured to map the data of the key entry operation to one or more character sets according to a current keyboard layout selected by the user, wherein the layout mapping module is configured to switch the current keyboard layout to another keyboard layout based on a further user input, wherein the layout mapping module defines and stores various layout parameters of different keyboard layouts (110, 120, 130, 140, 150, 1102, 1103), wherein the one or more character sets contain characters corresponding to the key entry operation, and wherein the layout mapping module is configured to output the one or more character sets to a candidate word module; a dictionary module, configured to store candidate words; the candidate word module connected to the dictionary module and to the layout mapping module, wherein the candidate word module is configured to add the one or more character sets, outputted by the layout mapping module, to an input sequence, and to locate candidate words in the dictionary module and prioritize the candidate words based on the input sequence; and an output module connected to the candidate word module, and configured to display the prioritized candidate words. an input module, configured to detect a user input from a user, wherein the user input comprises a key entry operation, and wherein the input module is further configured to record data of the key entry operation and output the data to a layout mapping module; the layout mapping module connected to the input module, wherein the layout mapping module is configured to map the data of the key entry operation to one or more character sets according to a current keyboard layout selected by the user, wherein the layout mapping module is configured to switch the current keyboard layout to another keyboard layout based on a further user input, wherein the layout mapping module defines and stores various layout parameters of different keyboard layouts (110, 120, 130, 140, 150, 1102, 1103), wherein the one or more character sets contain characters corresponding to the key entry operation, and wherein the layout mapping module is configured to output the one or more character sets to a candidate word module; a dictionary module, configured to store candidate words; the candidate word module connected to the dictionary module and to the layout mapping module, wherein the candidate word module is configured to add the one or more character sets, outputted by the layout mapping module, to an input sequence, and to locate candidate words in the dictionary module and prioritize the candidate words based on the input sequence; and an output module connected to the candidate word module, and configured to display the prioritized candidate words.