mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-28 08:23:32 +01:00
Closes issue #397.
This commit is contained in:
@@ -1569,7 +1569,11 @@ var Events = Module("events", {
|
|||||||
const Hive = Class("Hive", {
|
const Hive = Class("Hive", {
|
||||||
init: function init(values, map) {
|
init: function init(values, map) {
|
||||||
this.name = "passkeys:" + map;
|
this.name = "passkeys:" + map;
|
||||||
this.stack = MapHive.Stack(values.map(function (v) v[map]));
|
this.stack = MapHive.Stack(values.map(function (v) Map(v[map + "Keys"])));
|
||||||
|
function Map(keys) ({
|
||||||
|
execute: function () Events.PASS_THROUGH,
|
||||||
|
keys: keys
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
get active() this.stack.length,
|
get active() this.stack.length,
|
||||||
@@ -1584,8 +1588,8 @@ var Events = Module("events", {
|
|||||||
flush: function flush() {
|
flush: function flush() {
|
||||||
memoize(this, "filters", function () this.value.filter(function (f) f(buffer.documentURI)));
|
memoize(this, "filters", function () this.value.filter(function (f) f(buffer.documentURI)));
|
||||||
memoize(this, "pass", function () set(array.flatten(this.filters.map(function (f) f.keys))));
|
memoize(this, "pass", function () set(array.flatten(this.filters.map(function (f) f.keys))));
|
||||||
memoize(this, "commandHive", function hive() Hive(this.filters, "commandMap"));
|
memoize(this, "commandHive", function hive() Hive(this.filters, "command"));
|
||||||
memoize(this, "inputHive", function hive() Hive(this.filters, "inputMap"));
|
memoize(this, "inputHive", function hive() Hive(this.filters, "input"));
|
||||||
},
|
},
|
||||||
|
|
||||||
has: function (key) set.has(this.pass, key) || set.has(this.commandHive.stack.mappings, key),
|
has: function (key) set.has(this.pass, key) || set.has(this.commandHive.stack.mappings, key),
|
||||||
@@ -1599,15 +1603,8 @@ var Events = Module("events", {
|
|||||||
let vals = Option.splitList(filter.result);
|
let vals = Option.splitList(filter.result);
|
||||||
filter.keys = events.fromString(vals[0]).map(events.closure.toString);
|
filter.keys = events.fromString(vals[0]).map(events.closure.toString);
|
||||||
|
|
||||||
let keys = vals.slice(1).map(events.closure.canonicalKeys);
|
filter.commandKeys = vals.slice(1).map(events.closure.canonicalKeys);
|
||||||
filter.commandMap = {
|
filter.inputKeys = filter.commandKeys.filter(/^<[ACM]-/);
|
||||||
execute: function () Events.PASS_THROUGH,
|
|
||||||
keys: keys
|
|
||||||
};
|
|
||||||
filter.inputMap = {
|
|
||||||
execute: function () Events.PASS_THROUGH,
|
|
||||||
keys: keys.filter(/^<[ACM]-/)
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
this.flush();
|
this.flush();
|
||||||
return values;
|
return values;
|
||||||
|
|||||||
Reference in New Issue
Block a user