Fix key code issue with punctuations and other special characters