From 6e92c636d33c2f67ee5c995742afb4bbc57a8df9 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Thu, 8 Jan 2015 13:50:00 -0500 Subject: [PATCH] toKey => toTarget --- lib/keypad.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/keypad.js b/lib/keypad.js index 7de82dde3..0f8717f69 100644 --- a/lib/keypad.js +++ b/lib/keypad.js @@ -84,7 +84,7 @@ var Controllers = { state.touches = touches(length); this.io.i2cRead(address, 0, 2, function(bytes) { - var key = this.toKey(bytes); + var target = this.toTarget(bytes); var mapped = null; var alias = null; @@ -98,7 +98,7 @@ var Controllers = { mapped = alias; } - if (key & (1 << i)) { + if (target & (1 << i)) { if (state.touches[i] === 0) { state.timeout = Date.now() + opts.holdTime; @@ -125,7 +125,7 @@ var Controllers = { }.bind(this)); } }, - toKey: { + toTarget: { value: function(raw) { if (raw.length !== 2) { return null; @@ -157,7 +157,7 @@ var Controllers = { this.io.pinMode(this.pin, this.io.MODES.ANALOG); this.io.analogRead(this.pin, function(adc) { - var key = this.toKey(adc); + var target = this.toTarget(adc); var mapped = null; var alias = null; @@ -169,7 +169,7 @@ var Controllers = { mapped = alias; } - if (key === i) { + if (target === i) { if (state.touches[i] === 0) { state.timeout = Date.now() + opts.holdTime; @@ -195,7 +195,7 @@ var Controllers = { }.bind(this)); }, }, - toKey: { + toTarget: { value: function(raw) { var state = priv.get(this); var scale = state.scale; @@ -257,7 +257,7 @@ var Controllers = { this.io.pinMode(this.pin, this.io.MODES.ANALOG); this.io.analogRead(this.pin, function(adc) { - var key = this.toKey(adc); + var target = this.toTarget(adc); var mapped = null; var alias = null; @@ -269,7 +269,7 @@ var Controllers = { mapped = alias; } - if (key === i) { + if (target === i) { if (state.touches[i] === 0) { state.timeout = Date.now() + opts.holdTime; trigger.call(this, "down", mapped); @@ -294,7 +294,7 @@ var Controllers = { }.bind(this)); } }, - toKey: { + toTarget: { value: function(raw) { var state = priv.get(this); var ranges = state.ranges;