fix unnecessary onScreenEvent change. fixes #142.

This commit is contained in:
Christopher Jeffrey 2015-06-19 17:59:06 -07:00
parent 8228142060
commit f3f4233a7a
1 changed files with 3 additions and 15 deletions

View File

@ -859,28 +859,16 @@ Element.prototype.disableDrag = function() {
};
Element.prototype.key = function(key, listener) {
// return this.screen.program.key.apply(this, arguments);
if (typeof key === 'string') key = key.split(/\s*,\s*/);
key.forEach(function(key) {
return this.onScreenEvent('key ' + key, listener);
}, this);
return this.screen.program.key.apply(this, arguments);
};
Element.prototype.onceKey = function(key, listener) {
// return this.screen.program.onceKey.apply(this, arguments);
if (typeof key === 'string') key = key.split(/\s*,\s*/);
key.forEach(function(key) {
return this.onceScreenEvent('key ' + key, listener);
}, this);
return this.screen.program.onceKey.apply(this, arguments);
};
Element.prototype.unkey =
Element.prototype.removeKey = function(key, listener) {
// return this.screen.program.unkey.apply(this, arguments);
if (typeof key === 'string') key = key.split(/\s*,\s*/);
key.forEach(function(key) {
return this.removeScreenEvent('key ' + key, listener);
}, this);
return this.screen.program.unkey.apply(this, arguments);
};
Element.prototype.setIndex = function(index) {