1. A keyboard comprising: a storage unit configured for storing a plurality of codes, each of the codes corresponding to a character assigned to a key on the keyboard; a format generating unit configured for analyzing a digital picture reflecting a desired layout of keys on the keyboard and generating a location matrix of the desired layout according to the digital picture; a character recognizing unit configured for recognizing the characters in the desired layout according to the digital picture and the location matrix; and an assigning unit configured for assigning the codes stored in the storage unit corresponding to the recognized characters to the corresponding keys, based upon the location matrix of the desired layout.