diff --git a/common/content/dactyl.js b/common/content/dactyl.js index f3f10481..05bada8c 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -645,7 +645,7 @@ const Dactyl = Module("dactyl", { let res =
{link(obj.name)}
{obj.description ? obj.description.replace(/\.$/, "") : ""}
- {template.map(obj.names, tag, " ")} + {template.map(obj.names.reverse, tag, " ")} {spec((obj.specs || obj.names)[0])}{ !obj.type ? "" : <> {obj.type} diff --git a/common/content/events.js b/common/content/events.js index f641a7f7..1ca0fd7c 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -818,6 +818,8 @@ const Events = Module("events", { modes.pop(); mode = modes.getStack(1); } + else if (!event.isMacro && !event.noremap && options.get("passkeys").has(events.toString(event))) + stop = true; // handle Escape-all-keys mode (Ctrl-q) if (stop) { @@ -959,7 +961,7 @@ const Events = Module("events", { // Prevent certain sites from transferring focus to an input box // before we get a chance to process our key bindings on the // "keypress" event. - if (!Events.isInputElemFocused() && !modes.passThrough) + if (!Events.isInputElemFocused() && !modes.passThrough && !options.get("passkeys").has(events.toString(event))) event.stopPropagation(); }, @@ -1094,6 +1096,24 @@ const Events = Module("events", { { arg: true, count: true }); }, options: function () { + options.add(["passkeys", "pk"], + "Pass certain keys through directly for the given URLs", + "regexpmap", "", { + has: function (key) { + let url = buffer.URI; + for (let re in values(this.value)) + if (re.test(url) && re.result.some(function (k) k === key)) + return true; + return false; + }, + setter: function (values) { + values.forEach(function (re) { + re.result = events.fromString(re.result).map(events.closure.toString); + re.result.toString = function toString() this.join(""); + }); + return values; + } + }); options.add(["strictfocus", "sf"], "Prevent scripts from focusing input elements without user intervention", "boolean", true); diff --git a/common/locale/en-US/index.xml b/common/locale/en-US/index.xml index 600b90fd..8e157ee3 100644 --- a/common/locale/en-US/index.xml +++ b/common/locale/en-US/index.xml @@ -407,6 +407,7 @@ This file contains a list of all available commands, mappings and options.
nextpattern
Patterns to use when guessing the 'next' page in a document sequence
online
Set the 'work offline' option
pageinfo
Desired info in the :pageinfo output
+
passkeys
Pass certain keys through directly for the given URLs
popups
Where to show requested popup windows
previouspattern
Patterns to use when guessing the 'previous' page in a document sequence
private
Set the 'private browsing' option
diff --git a/common/locale/en-US/options.xml b/common/locale/en-US/options.xml index 425323ea..cbfeb7dc 100644 --- a/common/locale/en-US/options.xml +++ b/common/locale/en-US/options.xml @@ -1087,9 +1087,8 @@
- 'pageinfo' 'pa' + 'pa' 'pageinfo' 'pageinfo' 'pa' - charlist gfm @@ -1110,6 +1109,23 @@ + + 'pk' 'passkeys' + 'passkeys' 'pk' + regexpmap + + +

+ Pass certain keys through directly for the given URLs. + For any page with a URL matching a given regexp, all key + events for keys listed in that regexp's value are passed + through directly to &dactyl.host;, and are not processed + by &dactyl.appName; in any way. +

+ :set passkeys+=https://mail\.google\.com/:jk +
+
+ 'pps' 'popups' 'popups' 'pps' diff --git a/pentadactyl/NEWS b/pentadactyl/NEWS index 8ac482f1..b7800ea8 100644 --- a/pentadactyl/NEWS +++ b/pentadactyl/NEWS @@ -78,7 +78,8 @@ * Added "passwords" and "venkman" dialogs to :dialog. * Added :extupdate command. * Replaced 'focuscontent' with 'strictfocus'. - * Add :if/:elseif/:else/:endif conditionals. + * Added :if/:elseif/:else/:endif conditionals. + * Added 'passkeys' option. * Changed 'urlseparator' default value to '|'. * Added 'wildanchor' option. * Added -javascript option to :abbrev and :map.