mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-30 02:53:35 +02:00
Get rid of absurd config.ignoreKeys. Closes issue #406.
This commit is contained in:
@@ -1232,12 +1232,10 @@ var Events = Module("events", {
|
|||||||
if (ignore)
|
if (ignore)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
// FIXME: Why is this hard coded? --Kris
|
||||||
if (key == "<C-c>")
|
if (key == "<C-c>")
|
||||||
util.interrupted = true;
|
util.interrupted = true;
|
||||||
|
|
||||||
if (config.ignoreKeys[key] & mode.main)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
this.processor = ProcessorStack(mode, mappings.hives.array, event.noremap);
|
this.processor = ProcessorStack(mode, mappings.hives.array, event.noremap);
|
||||||
this.processor.keyEvents = this.keyEvents;
|
this.processor.keyEvents = this.keyEvents;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -324,12 +324,6 @@ var ConfigBase = Class("ConfigBase", {
|
|||||||
*/
|
*/
|
||||||
host: null,
|
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.
|
* @property {[[]]} An array of application specific mode specifications.
|
||||||
* The values of each mode are passed to modes.addMode during
|
* The values of each mode are passed to modes.addMode during
|
||||||
|
|||||||
@@ -341,14 +341,15 @@ var Config = Module("config", ConfigBase, {
|
|||||||
.getAttribute("sidebarcommand");
|
.getAttribute("sidebarcommand");
|
||||||
}, false);
|
}, 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) {
|
modes: function (dactyl, modules, window) {
|
||||||
const { config, modes } = modules;
|
const { modes } = modules;
|
||||||
config.ignoreKeys = {
|
|
||||||
"<Return>": modes.NORMAL,
|
|
||||||
"<Space>": modes.NORMAL,
|
|
||||||
"<Up>": modes.NORMAL,
|
|
||||||
"<Down>": modes.NORMAL
|
|
||||||
};
|
|
||||||
config.modes.forEach(function (mode) { modes.addMode.apply(this, mode); });
|
config.modes.forEach(function (mode) { modes.addMode.apply(this, mode); });
|
||||||
},
|
},
|
||||||
options: function (dactyl, modules, window) {
|
options: function (dactyl, modules, window) {
|
||||||
|
|||||||
Reference in New Issue
Block a user