From 7e712dae0f2fdc3a91d4193ca860cb9701007eb5 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sat, 25 Dec 2010 13:37:26 -0500 Subject: [PATCH] Fix some key handling bugs. Closes issue #210. --- common/content/commandline.js | 2 ++ common/content/events.js | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/common/content/commandline.js b/common/content/commandline.js index 739cda81..0e2a9fa8 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -470,6 +470,7 @@ const CommandLine = Module("commandline", { this.widgets.message = null; modes.push(modes.COMMAND_LINE, this.currentExtendedMode, { + onEvent: this.closure.onEvent, leave: function (params) { if (params.pop) commandline.leave(); @@ -746,6 +747,7 @@ const CommandLine = Module("commandline", { modes.push(modes.COMMAND_LINE, modes.PROMPT | extra.extended, update(Object.create(extra), { + onEvent: extra.onEvent || this.closure.onEvent, leave: function leave(stack) { commandline.leave(stack); leave.supercall(this, stack); diff --git a/common/content/events.js b/common/content/events.js index d1166e2b..bb99b277 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -1011,11 +1011,11 @@ const Events = Module("events", { } let res = this.onKeyPress(event); - if (res === true) + if (res === true || res == null) kill(event); else if (isArray(res)) { if (this.fallthrough) { - if (this.fallthrough(res[0]) === true) + if (dactyl.trapErrors(this.fallthrough, this, res[0]) === true) kill(res[0]); } else if (Events.isEscape(event)) @@ -1025,10 +1025,6 @@ const Events = Module("events", { dactyl.beep(); kill(event); } - - if (this.main == modes.COMMAND_LINE) - if (!(this.extended & modes.INPUT_MULTILINE)) - dactyl.trapErrors(commandline.onEvent, commandline, event); } // Reprocess unconsumed events