mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-14 15:25:54 +01:00
Prevent certain sites from overriding mappings. Closes issue #118.
This commit is contained in:
@@ -97,7 +97,9 @@ var EventHive = Class("EventHive", Contexts.Hive, {
|
|||||||
* @instance events
|
* @instance events
|
||||||
*/
|
*/
|
||||||
var Events = Module("events", {
|
var Events = Module("events", {
|
||||||
dbg: function () {},
|
dbg: function (...args) {
|
||||||
|
util.dump(...args);
|
||||||
|
},
|
||||||
|
|
||||||
debug: false,
|
debug: false,
|
||||||
|
|
||||||
@@ -818,11 +820,13 @@ var Events = Module("events", {
|
|||||||
|
|
||||||
if (!this.processor && event.type === "keydown" &&
|
if (!this.processor && event.type === "keydown" &&
|
||||||
options.get("passunknown").getKey(modes.main.allBases)) {
|
options.get("passunknown").getKey(modes.main.allBases)) {
|
||||||
if (!(modes.main.count && /^\d$/.test(key)))
|
if (modes.main.count && /^\d$/.test(key))
|
||||||
return true;
|
return false;
|
||||||
|
|
||||||
if (modes.main.allBases.some(hasCandidates))
|
if (modes.main.allBases.some(hasCandidates))
|
||||||
return true;
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -245,8 +245,9 @@ var MapHive = Class("MapHive", Contexts.Hive, {
|
|||||||
get: function (mode, cmd, skipPassThrough = false) {
|
get: function (mode, cmd, skipPassThrough = false) {
|
||||||
let map = this.getStack(mode).mappings[cmd];
|
let map = this.getStack(mode).mappings[cmd];
|
||||||
|
|
||||||
if (skipPassThrough && map && !map.passThrough)
|
if (skipPassThrough && map && map.passThrough)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user