Reset keyboard layout to default and wipe out all earlier settings
Solution 1:
I had the same problem and the following command worked for me
dpkg-reconfigure keyboard-configuration
(following a suggestion by @Byte Commander)
Solution 2:
only that helps me
dconf reset -f /org/gnome/