/
CCMacro.js
1605 lines (1441 loc) · 35.5 KB
/
CCMacro.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/****************************************************************************
Copyright (c) 2008-2010 Ricardo Quesada
Copyright (c) 2011-2012 cocos2d-x.org
Copyright (c) 2013-2016 Chukong Technologies Inc.
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
/**
* Predefined constants
* @class macro
* @static
*/
cc.macro = {
/**
* PI / 180
* @property RAD
* @type {Number}
*/
RAD: Math.PI / 180,
/**
* One degree
* @property DEG
* @type {Number}
*/
DEG: 180 / Math.PI,
/**
* @property REPEAT_FOREVER
* @type {Number}
*/
REPEAT_FOREVER: (Number.MAX_VALUE - 1),
/**
* @property FLT_EPSILON
* @type {Number}
*/
FLT_EPSILON: 0.0000001192092896,
/**
* Minimum z index value for node
* @property MIN_ZINDEX
* @type {Number}
*/
MIN_ZINDEX: -Math.pow(2, 15),
/**
* Maximum z index value for node
* @property MAX_ZINDEX
* @type {Number}
*/
MAX_ZINDEX: Math.pow(2, 15) - 1,
//some gl constant variable
/**
* @property ONE
* @type {Number}
*/
ONE: 1,
/**
* @property ZERO
* @type {Number}
*/
ZERO: 0,
/**
* @property SRC_ALPHA
* @type {Number}
*/
SRC_ALPHA: 0x0302,
/**
* @property SRC_ALPHA_SATURATE
* @type {Number}
*/
SRC_ALPHA_SATURATE: 0x308,
/**
* @property SRC_COLOR
* @type {Number}
*/
SRC_COLOR: 0x300,
/**
* @property DST_ALPHA
* @type {Number}
*/
DST_ALPHA: 0x304,
/**
* @property DST_COLOR
* @type {Number}
*/
DST_COLOR: 0x306,
/**
* @property ONE_MINUS_SRC_ALPHA
* @type {Number}
*/
ONE_MINUS_SRC_ALPHA: 0x0303,
/**
* @property ONE_MINUS_SRC_COLOR
* @type {Number}
*/
ONE_MINUS_SRC_COLOR: 0x301,
/**
* @property ONE_MINUS_DST_ALPHA
* @type {Number}
*/
ONE_MINUS_DST_ALPHA: 0x305,
/**
* @property ONE_MINUS_DST_COLOR
* @type {Number}
*/
ONE_MINUS_DST_COLOR: 0x0307,
/**
* @property ONE_MINUS_CONSTANT_ALPHA
* @type {Number}
*/
ONE_MINUS_CONSTANT_ALPHA: 0x8004,
/**
* @property ONE_MINUS_CONSTANT_COLOR
* @type {Number}
*/
ONE_MINUS_CONSTANT_COLOR: 0x8002,
//Possible device orientations
/**
* Oriented vertically
* @property ORIENTATION_PORTRAIT
* @type {Number}
*/
ORIENTATION_PORTRAIT: 1,
/**
* Oriented horizontally
* @property ORIENTATION_LANDSCAPE
* @type {Number}
*/
ORIENTATION_LANDSCAPE: 2,
/**
* Oriented automatically
* @property ORIENTATION_AUTO
* @type {Number}
*/
ORIENTATION_AUTO: 3,
DENSITYDPI_DEVICE: 'device-dpi',
DENSITYDPI_HIGH: 'high-dpi',
DENSITYDPI_MEDIUM: 'medium-dpi',
DENSITYDPI_LOW: 'low-dpi',
// General configurations
/**
* <p>
* If enabled, the texture coordinates will be calculated by using this formula: <br/>
* - texCoord.left = (rect.x*2+1) / (texture.wide*2); <br/>
* - texCoord.right = texCoord.left + (rect.width*2-2)/(texture.wide*2); <br/>
* <br/>
* The same for bottom and top. <br/>
* <br/>
* This formula prevents artifacts by using 99% of the texture. <br/>
* The "correct" way to prevent artifacts is by expand the texture's border with the same color by 1 pixel<br/>
* <br/>
* Affected component: <br/>
* - cc.TMXLayer <br/>
* <br/>
* Enabled by default. To disabled set it to 0. <br/>
* To modify it, in Web engine please refer to CCMacro.js, in JSB please refer to CCConfig.h
* </p>
*
* @property {Number} FIX_ARTIFACTS_BY_STRECHING_TEXEL_TMX
*/
FIX_ARTIFACTS_BY_STRECHING_TEXEL_TMX: true,
/**
* Position of the FPS (Default: 0,0 (bottom-left corner))<br/>
* To modify it, in Web engine please refer to CCMacro.js, in JSB please refer to CCConfig.h
* @property {Vec2} DIRECTOR_STATS_POSITION
*/
DIRECTOR_STATS_POSITION: cc.v2(0, 0),
/**
* <p>
* If enabled, actions that alter the position property (eg: CCMoveBy, CCJumpBy, CCBezierBy, etc..) will be stacked. <br/>
* If you run 2 or more 'position' actions at the same time on a node, then end position will be the sum of all the positions. <br/>
* If disabled, only the last run action will take effect.
* </p>
* @property {Number} ENABLE_STACKABLE_ACTIONS
*/
ENABLE_STACKABLE_ACTIONS: true,
/**
* !#en
* The timeout to determine whether a touch is no longer active and should be removed.
* The reason to add this timeout is due to an issue in X5 browser core,
* when X5 is presented in wechat on Android, if a touch is glissed from the bottom up, and leave the page area,
* no touch cancel event is triggered, and the touch will be considered active forever.
* After multiple times of this action, our maximum touches number will be reached and all new touches will be ignored.
* So this new mechanism can remove the touch that should be inactive if it's not updated during the last 5000 milliseconds.
* Though it might remove a real touch if it's just not moving for the last 5 seconds which is not easy with the sensibility of mobile touch screen.
* You can modify this value to have a better behavior if you find it's not enough.
* !#zh
* 用于甄别一个触点对象是否已经失效并且可以被移除的延时时长
* 添加这个时长的原因是 X5 内核在微信浏览器中出现的一个 bug。
* 在这个环境下,如果用户将一个触点从底向上移出页面区域,将不会触发任何 touch cancel 或 touch end 事件,而这个触点会被永远当作停留在页面上的有效触点。
* 重复这样操作几次之后,屏幕上的触点数量将达到我们的事件系统所支持的最高触点数量,之后所有的触摸事件都将被忽略。
* 所以这个新的机制可以在触点在一定时间内没有任何更新的情况下视为失效触点并从事件系统中移除。
* 当然,这也可能移除一个真实的触点,如果用户的触点真的在一定时间段内完全没有移动(这在当前手机屏幕的灵敏度下会很难)。
* 你可以修改这个值来获得你需要的效果,默认值是 5000 毫秒。
* @property {Number} TOUCH_TIMEOUT
*/
TOUCH_TIMEOUT: 5000,
/**
* !#en
* The maximum vertex count for a single batched draw call.
* !#zh
* 最大可以被单次批处理渲染的顶点数量。
* @property {Number} BATCH_VERTEX_COUNT
*/
BATCH_VERTEX_COUNT: 20000,
/**
* !#en
* Whether or not enabled tiled map auto culling. If you set the TiledMap skew or rotation, then need to manually disable this, otherwise, the rendering will be wrong.
* !#zh
* 是否开启瓦片地图的自动裁减功能。瓦片地图如果设置了 skew, rotation 或者采用了摄像机的话,需要手动关闭,否则渲染会出错。
* @property {Boolean} ENABLE_TILEDMAP_CULLING
* @default true
*/
ENABLE_TILEDMAP_CULLING: true,
/**
* !#en
* Boolean that indicates if the canvas contains an alpha channel, default sets to false for better performance.
* Though if you want to make your canvas background transparent and show other dom elements at the background,
* you can set it to true before `cc.game.run`.
* Web only.
* !#zh
* 用于设置 Canvas 背景是否支持 alpha 通道,默认为 false,这样可以有更高的性能表现。
* 如果你希望 Canvas 背景是透明的,并显示背后的其他 DOM 元素,你可以在 `cc.game.run` 之前将这个值设为 true。
* 仅支持 Web
* @property {Boolean} ENABLE_TRANSPARENT_CANVAS
* @default false
*/
ENABLE_TRANSPARENT_CANVAS: false,
/**
* !#en
* Boolean that indicates if the WebGL context is created with `antialias` option turned on, default value is false.
* Set it to true could make your game graphics slightly smoother, like texture hard edges when rotated.
* Whether to use this really depend on your game design and targeted platform,
* device with retina display usually have good detail on graphics with or without this option,
* you probably don't want antialias if your game style is pixel art based.
* Also, it could have great performance impact with some browser / device using software MSAA.
* You can set it to true before `cc.game.run`.
* Web only.
* !#zh
* 用于设置在创建 WebGL Context 时是否开启抗锯齿选项,默认值是 false。
* 将这个选项设置为 true 会让你的游戏画面稍稍平滑一些,比如旋转硬边贴图时的锯齿。是否开启这个选项很大程度上取决于你的游戏和面向的平台。
* 在大多数拥有 retina 级别屏幕的设备上用户往往无法区分这个选项带来的变化;如果你的游戏选择像素艺术风格,你也多半不会想开启这个选项。
* 同时,在少部分使用软件级别抗锯齿算法的设备或浏览器上,这个选项会对性能产生比较大的影响。
* 你可以在 `cc.game.run` 之前设置这个值,否则它不会生效。
* 仅支持 Web
* @property {Boolean} ENABLE_WEBGL_ANTIALIAS
* @default false
*/
ENABLE_WEBGL_ANTIALIAS: false,
/**
* !#en
* Whether or not enable auto culling.
* This feature have been removed in v2.0 new renderer due to overall performance consumption.
* We have no plan currently to re-enable auto culling.
* If your game have more dynamic objects, we suggest to disable auto culling.
* If your game have more static objects, we suggest to enable auto culling.
* !#zh
* 是否开启自动裁减功能,开启裁减功能将会把在屏幕外的物体从渲染队列中去除掉。
* 这个功能在 v2.0 的新渲染器中被移除了,因为它在大多数游戏中所带来的损耗要高于性能的提升,目前我们没有计划重新支持自动裁剪。
* 如果游戏中的动态物体比较多的话,建议将此选项关闭。
* 如果游戏中的静态物体比较多的话,建议将此选项打开。
* @property {Boolean} ENABLE_CULLING
* @deprecated since v2.0
* @default false
*/
ENABLE_CULLING: false,
/**
* !#en
* Whether to clear the original image cache after uploaded a texture to GPU. If cleared, [Dynamic Atlas](https://docs.cocos.com/creator/2.4/manual/en/advanced-topics/dynamic-atlas.html) will not be supported.
* Normally you don't need to enable this option on the web platform, because Image object doesn't consume too much memory.
* But on WeChat Game platform, the current version cache decoded data in Image object, which has high memory usage.
* So we enabled this option by default on WeChat, so that we can release Image cache immediately after uploaded to GPU.
* !#zh
* 是否在将贴图上传至 GPU 之后删除原始图片缓存,删除之后图片将无法进行 [动态合图](https://docs.cocos.com/creator/2.4/manual/zh/advanced-topics/dynamic-atlas.html)。
* 在 Web 平台,你通常不需要开启这个选项,因为在 Web 平台 Image 对象所占用的内存很小。
* 但是在微信小游戏平台的当前版本,Image 对象会缓存解码后的图片数据,它所占用的内存空间很大。
* 所以我们在微信平台默认开启了这个选项,这样我们就可以在上传 GL 贴图之后立即释放 Image 对象的内存,避免过高的内存占用。
* @property {Boolean} CLEANUP_IMAGE_CACHE
* @default false
*/
CLEANUP_IMAGE_CACHE: false,
/**
* !#en
* Whether or not show mesh wire frame.
* !#zh
* 是否显示网格的线框。
* @property {Boolean} SHOW_MESH_WIREFRAME
* @default false
*/
SHOW_MESH_WIREFRAME: false,
/**
* !#en
* Whether or not show mesh normal.
* !#zh
* 是否显示网格的法线。
* @property {Boolean} SHOW_MESH_NORMAL
* @default false
*/
SHOW_MESH_NORMAL: false,
/**
* !#en
* Whether to enable multi-touch.
* !#zh
* 是否开启多点触摸
* @property {Boolean} ENABLE_MULTI_TOUCH
* @default true
*/
ENABLE_MULTI_TOUCH: true,
/**
* References:
* https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap
* https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap
*
* !#en
* Whether to use image bitmap first. If enabled, memory usage will increase.
*
* !#zh
* 是否优先使用 image bitmap,启用之后,内存占用会变高
*
* @property {Boolean} ALLOW_IMAGE_BITMAP
* @default true
*/
ALLOW_IMAGE_BITMAP: !cc.sys.isMobile,
/**
* !#en
* Whether to use native TTF renderer which is faster but layout slightly different.
*
* !#zh
* 是否使用原生的文本渲染机制, 布局和编辑器有差异.
*
* @property {Boolean} ENABLE_NATIVE_TTF_RENDERER
* @default true
*/
ENABLE_NATIVE_TTF_RENDERER: true
};
Object.defineProperty(cc.macro, 'ROTATE_ACTION_CCW', {
set (value) {
if (cc.RotateTo && cc.RotateBy) {
cc.RotateTo._reverse = cc.RotateBy._reverse = value;
}
}
});
let SUPPORT_TEXTURE_FORMATS = ['.astc', '.pkm', '.pvr', '.webp', '.jpg', '.jpeg', '.bmp', '.png'];
/**
* !#en
* The image format supported by the engine defaults, and the supported formats may differ in different build platforms and device types.
* Currently all platform and device support ['.astc', '.webp', '.jpg', '.jpeg', '.bmp', '.png'], The iOS mobile platform also supports the PVR format。
* !#zh
* 引擎默认支持的图片格式,支持的格式可能在不同的构建平台和设备类型上有所差别。
* 目前所有平台和设备支持的格式有 ['.astc', '.webp', '.jpg', '.jpeg', '.bmp', '.png']. 另外 Ios 手机平台还额外支持了 PVR 格式。
* @property {String[]} SUPPORT_TEXTURE_FORMATS
*/
cc.macro.SUPPORT_TEXTURE_FORMATS = SUPPORT_TEXTURE_FORMATS;
/**
* !#en Key map for keyboard event
* !#zh 键盘事件的按键值
* @enum macro.KEY
* @example {@link cocos2d/core/platform/CCCommon/KEY.js}
*/
cc.macro.KEY = {
/**
* !#en None
* !#zh 没有分配
* @property none
* @type {Number}
* @readonly
*/
none:0,
// android
/**
* !#en The back key
* !#zh 返回键
* @property back
* @type {Number}
* @readonly
*/
back:6,
/**
* !#en The menu key
* !#zh 菜单键
* @property menu
* @type {Number}
* @readonly
*/
menu:18,
/**
* !#en The backspace key
* !#zh 退格键
* @property backspace
* @type {Number}
* @readonly
*/
backspace:8,
/**
* !#en The tab key
* !#zh Tab 键
* @property tab
* @type {Number}
* @readonly
*/
tab:9,
/**
* !#en The enter key
* !#zh 回车键
* @property enter
* @type {Number}
* @readonly
*/
enter:13,
/**
* !#en The shift key
* !#zh Shift 键
* @property shift
* @type {Number}
* @readonly
*/
shift:16, //should use shiftkey instead
/**
* !#en The ctrl key
* !#zh Ctrl 键
* @property ctrl
* @type {Number}
* @readonly
*/
ctrl:17, //should use ctrlkey
/**
* !#en The alt key
* !#zh Alt 键
* @property alt
* @type {Number}
* @readonly
*/
alt:18, //should use altkey
/**
* !#en The pause key
* !#zh 暂停键
* @property pause
* @type {Number}
* @readonly
*/
pause:19,
/**
* !#en The caps lock key
* !#zh 大写锁定键
* @property capslock
* @type {Number}
* @readonly
*/
capslock:20,
/**
* !#en The esc key
* !#zh ESC 键
* @property escape
* @type {Number}
* @readonly
*/
escape:27,
/**
* !#en The space key
* !#zh 空格键
* @property space
* @type {Number}
* @readonly
*/
space:32,
/**
* !#en The page up key
* !#zh 向上翻页键
* @property pageup
* @type {Number}
* @readonly
*/
pageup:33,
/**
* !#en The page down key
* !#zh 向下翻页键
* @property pagedown
* @type {Number}
* @readonly
*/
pagedown:34,
/**
* !#en The end key
* !#zh 结束键
* @property end
* @type {Number}
* @readonly
*/
end:35,
/**
* !#en The home key
* !#zh 主菜单键
* @property home
* @type {Number}
* @readonly
*/
home:36,
/**
* !#en The left key
* !#zh 向左箭头键
* @property left
* @type {Number}
* @readonly
*/
left:37,
/**
* !#en The up key
* !#zh 向上箭头键
* @property up
* @type {Number}
* @readonly
*/
up:38,
/**
* !#en The right key
* !#zh 向右箭头键
* @property right
* @type {Number}
* @readonly
*/
right:39,
/**
* !#en The down key
* !#zh 向下箭头键
* @property down
* @type {Number}
* @readonly
*/
down:40,
/**
* !#en The select key
* !#zh Select 键
* @property select
* @type {Number}
* @readonly
*/
select:41,
/**
* !#en The insert key
* !#zh 插入键
* @property insert
* @type {Number}
* @readonly
*/
insert:45,
/**
* !#en The Delete key
* !#zh 删除键
* @property Delete
* @type {Number}
* @readonly
*/
Delete:46,
/**
* !#en The '0' key on the top of the alphanumeric keyboard.
* !#zh 字母键盘上的 0 键
* @property 0
* @type {Number}
* @readonly
*/
0:48,
/**
* !#en The '1' key on the top of the alphanumeric keyboard.
* !#zh 字母键盘上的 1 键
* @property 1
* @type {Number}
* @readonly
*/
1:49,
/**
* !#en The '2' key on the top of the alphanumeric keyboard.
* !#zh 字母键盘上的 2 键
* @property 2
* @type {Number}
* @readonly
*/
2:50,
/**
* !#en The '3' key on the top of the alphanumeric keyboard.
* !#zh 字母键盘上的 3 键
* @property 3
* @type {Number}
* @readonly
*/
3:51,
/**
* !#en The '4' key on the top of the alphanumeric keyboard.
* !#zh 字母键盘上的 4 键
* @property 4
* @type {Number}
* @readonly
*/
4:52,
/**
* !#en The '5' key on the top of the alphanumeric keyboard.
* !#zh 字母键盘上的 5 键
* @property 5
* @type {Number}
* @readonly
*/
5:53,
/**
* !#en The '6' key on the top of the alphanumeric keyboard.
* !#zh 字母键盘上的 6 键
* @property 6
* @type {Number}
* @readonly
*/
6:54,
/**
* !#en The '7' key on the top of the alphanumeric keyboard.
* !#zh 字母键盘上的 7 键
* @property 7
* @type {Number}
* @readonly
*/
7:55,
/**
* !#en The '8' key on the top of the alphanumeric keyboard.
* !#zh 字母键盘上的 8 键
* @property 8
* @type {Number}
* @readonly
*/
8:56,
/**
* !#en The '9' key on the top of the alphanumeric keyboard.
* !#zh 字母键盘上的 9 键
* @property 9
* @type {Number}
* @readonly
*/
9:57,
/**
* !#en The a key
* !#zh A 键
* @property a
* @type {Number}
* @readonly
*/
a:65,
/**
* !#en The b key
* !#zh B 键
* @property b
* @type {Number}
* @readonly
*/
b:66,
/**
* !#en The c key
* !#zh C 键
* @property c
* @type {Number}
* @readonly
*/
c:67,
/**
* !#en The d key
* !#zh D 键
* @property d
* @type {Number}
* @readonly
*/
d:68,
/**
* !#en The e key
* !#zh E 键
* @property e
* @type {Number}
* @readonly
*/
e:69,
/**
* !#en The f key
* !#zh F 键
* @property f
* @type {Number}
* @readonly
*/
f:70,
/**
* !#en The g key
* !#zh G 键
* @property g
* @type {Number}
* @readonly
*/
g:71,
/**
* !#en The h key
* !#zh H 键
* @property h
* @type {Number}
* @readonly
*/
h:72,
/**
* !#en The i key
* !#zh I 键
* @property i
* @type {Number}
* @readonly
*/
i:73,
/**
* !#en The j key
* !#zh J 键
* @property j
* @type {Number}
* @readonly
*/
j:74,
/**
* !#en The k key
* !#zh K 键
* @property k
* @type {Number}
* @readonly
*/
k:75,
/**
* !#en The l key
* !#zh L 键
* @property l
* @type {Number}
* @readonly
*/
l:76,
/**
* !#en The m key
* !#zh M 键
* @property m
* @type {Number}
* @readonly
*/
m:77,
/**
* !#en The n key
* !#zh N 键
* @property n
* @type {Number}
* @readonly
*/
n:78,
/**
* !#en The o key
* !#zh O 键
* @property o
* @type {Number}
* @readonly
*/
o:79,
/**
* !#en The p key
* !#zh P 键
* @property p
* @type {Number}
* @readonly
*/
p:80,
/**
* !#en The q key
* !#zh Q 键
* @property q
* @type {Number}
* @readonly
*/
q:81,
/**
* !#en The r key
* !#zh R 键
* @property r
* @type {Number}
* @readonly
*/
r:82,
/**
* !#en The s key
* !#zh S 键
* @property s
* @type {Number}
* @readonly
*/
s:83,
/**
* !#en The t key
* !#zh T 键
* @property t
* @type {Number}
* @readonly
*/
t:84,
/**
* !#en The u key
* !#zh U 键
* @property u
* @type {Number}
* @readonly
*/
u:85,
/**
* !#en The v key
* !#zh V 键
* @property v
* @type {Number}
* @readonly
*/
v:86,
/**
* !#en The w key
* !#zh W 键
* @property w
* @type {Number}
* @readonly
*/
w:87,
/**
* !#en The x key
* !#zh X 键
* @property x
* @type {Number}
* @readonly
*/
x:88,
/**
* !#en The y key
* !#zh Y 键
* @property y
* @type {Number}
* @readonly
*/
y:89,
/**
* !#en The z key
* !#zh Z 键
* @property z
* @type {Number}
* @readonly
*/
z:90,
/**
* !#en The numeric keypad 0
* !#zh 数字键盘 0
* @property num0
* @type {Number}
* @readonly
*/
num0:96,
/**
* !#en The numeric keypad 1
* !#zh 数字键盘 1
* @property num1
* @type {Number}
* @readonly
*/
num1:97,
/**
* !#en The numeric keypad 2
* !#zh 数字键盘 2
* @property num2
* @type {Number}
* @readonly
*/
num2:98,
/**
* !#en The numeric keypad 3
* !#zh 数字键盘 3
* @property num3
* @type {Number}
* @readonly
*/
num3:99,
/**
* !#en The numeric keypad 4
* !#zh 数字键盘 4