From 8a35363eaa3cb4a5e25eda7ae735032aec38a1bf Mon Sep 17 00:00:00 2001 From: knoxHuang <821686174@qq.com> Date: Wed, 17 Jan 2018 15:57:50 +0800 Subject: [PATCH] add keyCode api to EventCustom --- cocos2d/core/event/event.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cocos2d/core/event/event.js b/cocos2d/core/event/event.js index 0669fb4cb7..1378199339 100644 --- a/cocos2d/core/event/event.js +++ b/cocos2d/core/event/event.js @@ -326,6 +326,21 @@ EventCustom.prototype.getUserData = function () { EventCustom.prototype.getEventName = cc.Event.prototype.getType; +/** + * !#en + * The keyCode read-only property represents a system and implementation dependent numerical code identifying the unmodified value of the pressed key.
+ * This is usually the decimal ASCII (RFC 20) or Windows 1252 code corresponding to the key.
+ * If the key can't be identified, this value is 0.
+ * + * !#zh + * keyCode 是只读属性它表示一个系统和依赖于实现的数字代码,可以识别按键的未修改值。
+ * 这通常是十进制 ASCII (RFC20) 或者 Windows 1252 代码,所对应的密钥。
+ * 如果无法识别该键,则该值为 0。 + * + * @property keyCode + * @type {Number} + */ + var MAX_POOL_SIZE = 10; var _eventPool = new JS.Pool(MAX_POOL_SIZE); EventCustom.put = function (event) {