Skip to content

Commit

Permalink
Invert map, show binding -> key instead of key -> binding
Browse files Browse the repository at this point in the history
  • Loading branch information
deathcap committed Dec 26, 2013
1 parent 968bfb8 commit 2870d56
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ function BindingsUI(game, opts) {

if (!this.kb.bindings) throw 'kb-bindings-ui "kb" option could not find kb-bindings\' bindings';

this.bindingNames = {};
this.binding2Key = {};
for (var key in this.kb.bindings) {
var keyName = key.replace("<", "&lt;");
this.bindingNames[keyName] = this.kb.bindings[key];
this.addKey(keyName);
var binding = this.kb.bindings[key];
this.binding2Key[binding] = key;
this.addBinding(binding);
}
}

Expand All @@ -35,8 +35,8 @@ function isReserved(s) {
s === 'up';
}

BindingsUI.prototype.addKey = function (name) {
var item = this.folder.add(this.bindingNames, name);
BindingsUI.prototype.addBinding = function (name) {
var item = this.folder.add(this.binding2Key, name);
//item.onChange(updateBinding(this, name));
};

0 comments on commit 2870d56

Please sign in to comment.