Mercurial > MadButterfly
diff nodejs/mbapp.js @ 820:7875e8026e86
Change the key from up/down to left/right
author | wycc |
---|---|
date | Fri, 10 Sep 2010 08:33:07 +0800 |
parents | 37a1bd3e3ce1 |
children | 586e50f82c1f |
line wrap: on
line diff
--- a/nodejs/mbapp.js Fri Sep 10 00:11:38 2010 +0800 +++ b/nodejs/mbapp.js Fri Sep 10 08:33:07 2010 +0800 @@ -30,6 +30,7 @@ } app.prototype.KeyPress = function(evt) { + sys.puts(evt.sym); if (this.onKeyPress) this.onKeyPress(evt.sym); if (evt.sym in this.keymap) this.keymap[evt.sym](); } @@ -69,8 +70,11 @@ exports.app=app; // Put all key definition here +exports.KEY_LEFT = 0xff51; exports.KEY_UP = 0xff52; +exports.KEY_RIGHT = 0xff53; exports.KEY_DOWN = 0xff54; +exports.KEY_ENTER = 0xff0d; exports.EVT_ANY=0; exports.EVT_MOUSE_OVER=1; exports.EVT_MOUSE_OUT=2;