Abstract: A method and a device for automatically convert input typed using a multi layout physical or virtual keyboard to the correct layout. Some implementations also fix spelling mistakes and set the active layout to the desired layout. When a key such as the space bar is triggered, the implementation may feed the gestures into a machine learning model, the model then may output the estimated correct layout, and followingly cause replacing the characters, symbols or letters, corresponding to the typed keys in displayed words. Based on the estimated or detected language, the software of the implementation may check for spelling mistakes and will correct them.