如果通过键盘使用SHIFT键输入字符,则只有keydown
或keyup
事件可以跟踪SHIFT键的keyCode
,即16。
那么如何跟踪实际打印的字符的keyCode
?
我正在使用以下代码-
onkeyup='alert(event.keyCode)';// Always shows a message 16(keyCode of SHIFT) irrespective of the actual character
或者onkeydown='alert(event.keyCode)';// Always shows a message 16(keyCode of SHIFT) irrespective of the actual character
那么如何获取实际打印字符的keyCode
???