get a code corresponding to the chosen key and the typed word