Mercurial > MadButterfly
changeset 821:bfdc82bbd6e4
Merge from the head
author | wycc |
---|---|
date | Tue, 14 Sep 2010 00:25:44 +0800 |
parents | 7875e8026e86 (diff) 856c919659cc (current diff) |
children | 586e50f82c1f |
files | |
diffstat | 2 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/nodejs/mbapp.js Mon Sep 13 20:41:07 2010 +0800 +++ b/nodejs/mbapp.js Tue Sep 14 00:25:44 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;
--- a/nodejs/testdesktop.js Mon Sep 13 20:41:07 2010 +0800 +++ b/nodejs/testdesktop.js Tue Sep 14 00:25:44 2010 +0800 @@ -16,8 +16,11 @@ item = 0; an = new animate.scale(app,items[item],1,1.5,0.1); an.start(); +setInterval(function() { + -app.addKeyListener(mbapp.KEY_UP, function() { +}, 300); +app.addKeyListener(mbapp.KEY_LEFT, function() { var old = items[item]; item = item - 1; if (item == -1) { @@ -31,7 +34,7 @@ an.start(); }); -app.addKeyListener(mbapp.KEY_DOWN, function() { +app.addKeyListener(mbapp.KEY_RIGHT, function() { var old = items[item]; item = item + 1; if (item == items.length) {