From 3132b2de229a46bcc03d4a8555b045d8e0629920 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sat, 19 Feb 2011 03:22:42 -0500 Subject: [PATCH] Fix stacked key handling issues when fallthrough handlers are present. Fixes regression of issue #15. --- common/content/events.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/common/content/events.js b/common/content/events.js index 9f51d72a..26159c9c 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -53,12 +53,17 @@ var ProcessorStack = Class("ProcessorStack", { events.feedingKeys = false; } - for (var res = this.actions[0]; callable(res);) { - res = dactyl.trapErrors(res); - events.dbg("ACTION RES: " + res); + for (var action in values(this.actions)) { + while (callable(action)) { + action = dactyl.trapErrors(action); + events.dbg("ACTION RES: " + action); + } + if (action !== Events.PASS) + break; } - result = res !== undefined ? res : Events.KILL; - if (res !== Events.PASS) + + result = action !== undefined ? action : Events.KILL; + if (action !== Events.PASS) this.processors.length = 0; } else if (this.processors.length) { @@ -221,7 +226,7 @@ var KeyProcessor = Class("KeyProcessor", { allEvents: this.allEvents, command: this.command, count: this.count, - events: this.events + keypressEvents: this.events }); }