I have a desktop in which I have installed Debain. I connected to it using vnc from my laptop and was typing some command when I observed that the complete Keyboard layout had changed to some unknown keyboard layout. I tried re-installing but the problem still existed. So when I googled it, I found this bug report which was luckily resolved and the solution was also shared in it.
Hence all I had to do to solve the problem was to add the following line in $HOME/.vnc/xstartup before the last line /etc/X11/Xsession
'export XKL_XMODMAP_DISABLE=1' x