获取键盘事件中的keyCode

这个api主要是获取按键下的对应的键值。

 

关于event.which和event.keyCode的可以查看http://zhangyaochun.iteye.com/blog/1392504

 

 

/*
*getKeyCode---get the keycode*
*@function*
*@param {Event} e*
*@return {HTMLElement}*
*/
ZYC.event.getKeyCode = function(e){
    return e.which || e.keyCode;
};

你可能感兴趣的:(event,getKeyCode)