1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-08 03:25:46 +01:00

Get rid of absurd config.ignoreKeys. Closes issue #406.

This commit is contained in:
Kris Maglione
2011-03-01 18:38:12 -05:00
parent f34e2a96f1
commit 7f447b911c
3 changed files with 9 additions and 16 deletions

View File

@@ -1232,12 +1232,10 @@ var Events = Module("events", {
if (ignore)
return null;
// FIXME: Why is this hard coded? --Kris
if (key == "<C-c>")
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;
}

View File

@@ -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

View File

@@ -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],
["<Return>", "<Space>", "<Up>", "<Down>"],
"Handled by " + config.host,
function () Events.PASS_THROUGH);
},
modes: function (dactyl, modules, window) {
const { config, modes } = modules;
config.ignoreKeys = {
"<Return>": modes.NORMAL,
"<Space>": modes.NORMAL,
"<Up>": modes.NORMAL,
"<Down>": modes.NORMAL
};
const { modes } = modules;
config.modes.forEach(function (mode) { modes.addMode.apply(this, mode); });
},
options: function (dactyl, modules, window) {