how can i track arrow keys in Chrome and IE?

后端 未结 7 1291
后悔当初
后悔当初 2020-12-06 01:26

Im using foloowing code to track key events

oEvent=window.event || oEvent;
    iKeyCode=oEvent.keyCode || oEvent.which;alert(iKeyCode);

its

7条回答
  •  执念已碎
    2020-12-06 01:45

    I've just faced same problem. There is at least one difference Chrome handles the keypress and keydown/keyup events. keypress event in Chrome is not fired for arrow keys, whereas for keydown and keyup it is.

提交回复
热议问题