Class cc.KeyboardDelegate
- Defined in: CCKeyboardDelegate.js
- Extends cc.Class
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
you must extend the keyboardDelegate and
implement your own game logic in
keydown and keyup functions
|
Method Summary
Class Detail
cc.KeyboardDelegate()
you must extend the keyboardDelegate and
implement your own game logic in
keydown and keyup functions
Method Detail
-
onKeyDown(keyCode)Call back when a key is pressed down
// example if(keyCode == cc.KEY.w){}- Parameters:
- {Integer} keyCode
-
onKeyUp(keyCode)Call back when a key is released
// example if(keyCode == cc.KEY.w){}- Parameters:
- {Integer} keyCode