From 7f447b911c0f4523251560d24155734614ec0be8 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 1 Mar 2011 18:38:12 -0500 Subject: [PATCH] Get rid of absurd config.ignoreKeys. Closes issue #406. --- common/content/events.js | 4 +--- common/modules/config.jsm | 6 ------ pentadactyl/content/config.js | 15 ++++++++------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/common/content/events.js b/common/content/events.js index c16b6e64..93af7226 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -1232,12 +1232,10 @@ var Events = Module("events", { if (ignore) return null; + // FIXME: Why is this hard coded? --Kris if (key == "") util.interrupted = true; - if (config.ignoreKeys[key] & mode.main) - return null; - this.processor = ProcessorStack(mode, mappings.hives.array, event.noremap); this.processor.keyEvents = this.keyEvents; } diff --git a/common/modules/config.jsm b/common/modules/config.jsm index d1680f73..5c817582 100644 --- a/common/modules/config.jsm +++ b/common/modules/config.jsm @@ -324,12 +324,6 @@ var ConfigBase = Class("ConfigBase", { */ host: null, - /** - * @property {Object} A map between key names for key events which should be ignored, - * and a mask of the modes in which they should be ignored. - */ - ignoreKeys: {}, // NOTE: be aware you can't put useful values in here, as "modes.NORMAL" etc. are not defined at this time - /** * @property {[[]]} An array of application specific mode specifications. * The values of each mode are passed to modes.addMode during diff --git a/pentadactyl/content/config.js b/pentadactyl/content/config.js index 749d34d9..bea2e6fe 100644 --- a/pentadactyl/content/config.js +++ b/pentadactyl/content/config.js @@ -341,14 +341,15 @@ var Config = Module("config", ConfigBase, { .getAttribute("sidebarcommand"); }, false); }, + mappings: function initMappings(dactyl, modules, window) { + const { Events, mappings, modes } = modules; + mappings.add([modes.NORMAL], + ["", "", "", ""], + "Handled by " + config.host, + function () Events.PASS_THROUGH); + }, modes: function (dactyl, modules, window) { - const { config, modes } = modules; - config.ignoreKeys = { - "": modes.NORMAL, - "": modes.NORMAL, - "": modes.NORMAL, - "": modes.NORMAL - }; + const { modes } = modules; config.modes.forEach(function (mode) { modes.addMode.apply(this, mode); }); }, options: function (dactyl, modules, window) {