comparison nodejs/mbapp.js @ 911:7c4df3c1027f

Fix the indentation
author wycc
date Tue, 19 Oct 2010 04:06:45 +0800
parents 45625c200efe
children e4474cac20da
comparison
equal deleted inserted replaced
910:410478ded5d2 911:7c4df3c1027f
105 svg.loadSVG(this.mb_rt,this.mb_rt.root,fname); 105 svg.loadSVG(this.mb_rt,this.mb_rt.root,fname);
106 } 106 }
107 107
108 app.prototype.KeyPress = function(evt) { 108 app.prototype.KeyPress = function(evt) {
109 if (this.onKeyPress) this.onKeyPress(evt.sym); 109 if (this.onKeyPress) this.onKeyPress(evt.sym);
110 if (evt.sym in this.keymap) this.keymap[evt.sym](); 110 if (evt.sym in this.keymap) {
111 this.keymap[evt.sym]();
112 }
111 } 113 }
112 114
113 app.prototype.loop=function() { 115 app.prototype.loop=function() {
114 this.mb_rt.redraw_all(); 116 this.mb_rt.redraw_all();
115 this.mb_rt.flush(); 117 this.mb_rt.flush();
133 } 135 }
134 136
135 app.prototype.addKeyListener=function(key,f) { 137 app.prototype.addKeyListener=function(key,f) {
136 if (typeof(key) == 'number') 138 if (typeof(key) == 'number')
137 this.keymap[key] = f; 139 this.keymap[key] = f;
138 else { 140 else {
139 for(k in key) { 141 for(k in key) {
140 this.keymap[k] = f; 142 this.keymap[k] = f;
141 }
142 } 143 }
144 }
143 } 145 }
144 146
145 var app_with_win = function(display, win) { 147 var app_with_win = function(display, win) {
146 var self = this; 148 var self = this;
147 var mb_rt; 149 var mb_rt;